src/Entity/TypeEvenement.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TypeEvenementRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. #[ORM\Entity(repositoryClassTypeEvenementRepository::class)]
  9. class TypeEvenement
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\Column(type'string'length255nullabletrue)]
  16.     private $code;
  17.     #[ORM\Column(type'string'length255)]
  18.     private $nom;
  19.     #[Gedmo\Timestampable(on'create')]
  20.     #[ORM\Column(type'datetime')]
  21.     private $created_at;
  22.     #[Gedmo\Timestampable(on'update')]
  23.     #[ORM\Column(type'datetime')]
  24.     private $updated_at;
  25.     #[ORM\Column(type'integer')]
  26.     private $created_by;
  27.     #[ORM\Column(type'integer')]
  28.     private $updated_by;
  29.     #[ORM\OneToMany(mappedBy'type'targetEntityEvenement::class)]
  30.     private $evenements;
  31.     public function __construct()
  32.     {
  33.         $this->Evenements = new ArrayCollection();
  34.         $this->evenements = new ArrayCollection();
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getCode(): ?string
  41.     {
  42.         return $this->code;
  43.     }
  44.     public function setCode(?string $code): self
  45.     {
  46.         $this->code $code;
  47.         return $this;
  48.     }
  49.     public function getNom(): ?string
  50.     {
  51.         return $this->nom;
  52.     }
  53.     public function setNom(string $nom): self
  54.     {
  55.         $this->nom $nom;
  56.         return $this;
  57.     }
  58.     public function getCreatedAt(): ?\DateTimeInterface
  59.     {
  60.         return $this->created_at;
  61.     }
  62.     public function setCreatedAt(\DateTimeInterface $created_at): self
  63.     {
  64.         $this->created_at $created_at;
  65.         return $this;
  66.     }
  67.     public function getUpdatedAt(): ?\DateTimeInterface
  68.     {
  69.         return $this->updated_at;
  70.     }
  71.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  72.     {
  73.         $this->updated_at $updated_at;
  74.         return $this;
  75.     }
  76.     public function getCreatedBy(): ?int
  77.     {
  78.         return $this->created_by;
  79.     }
  80.     public function setCreatedBy(int $created_by): self
  81.     {
  82.         $this->created_by $created_by;
  83.         return $this;
  84.     }
  85.     public function getUpdatedBy(): ?int
  86.     {
  87.         return $this->updated_by;
  88.     }
  89.     public function setUpdatedBy(int $updated_by): self
  90.     {
  91.         $this->updated_by $updated_by;
  92.         return $this;
  93.     }
  94.     /**
  95.      * @return Collection<int, Evenement>
  96.      */
  97.     public function getEvenements(): Collection
  98.     {
  99.         return $this->evenements;
  100.     }
  101.     public function addEvenement(Evenement $evenement): self
  102.     {
  103.         if (!$this->evenements->contains($evenement)) {
  104.             $this->evenements[] = $evenement;
  105.             $evenement->setType($this);
  106.         }
  107.         return $this;
  108.     }
  109.     public function removeEvenement(Evenement $evenement): self
  110.     {
  111.         if ($this->evenements->removeElement($evenement)) {
  112.             // set the owning side to null (unless already changed)
  113.             if ($evenement->getType() === $this) {
  114.                 $evenement->setType(null);
  115.             }
  116.         }
  117.         return $this;
  118.     }
  119. }