src/Entity/Theme.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ThemeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassThemeRepository::class)]
  9. class Theme
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $labelFr null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $labelEn null;
  19.     #[ORM\Column(typeTypes::SMALLINTnullabletrue)]
  20.     private ?int $position null;
  21.     #[ORM\Column(nullabletrue)]
  22.     private ?int $createdBy null;
  23.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  24.     private ?\DateTimeInterface $createdAt null;
  25.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  26.     private ?\DateTimeInterface $updatedAt null;
  27.     # [ORM\OneToMany(targetEntity: EventAbstract::class, mappedBy: 'theme')]
  28.     // private Collection $eventAbstract;
  29.     #[ORM\ManyToMany(targetEntityEventAbstract::class, mappedBy'themes')]
  30.     private Collection $eventAbstracts;
  31.     public function __construct()
  32.     {
  33.         // $this->eventAbstract = new ArrayCollection();
  34.         $this->eventAbstracts = new ArrayCollection();
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getLabelFr(): ?string
  41.     {
  42.         return $this->labelFr;
  43.     }
  44.     public function setLabelFr(?string $labelFr): static
  45.     {
  46.         $this->labelFr $labelFr;
  47.         return $this;
  48.     }
  49.     public function getLabelEn(): ?string
  50.     {
  51.         return $this->labelEn;
  52.     }
  53.     public function setLabelEn(?string $labelEn): static
  54.     {
  55.         $this->labelEn $labelEn;
  56.         return $this;
  57.     }
  58.     public function getPosition(): ?int
  59.     {
  60.         return $this->position;
  61.     }
  62.     public function setPosition(?int $position): static
  63.     {
  64.         $this->position $position;
  65.         return $this;
  66.     }
  67.     public function getCreatedBy(): ?int
  68.     {
  69.         return $this->createdBy;
  70.     }
  71.     public function setCreatedBy(?int $createdBy): static
  72.     {
  73.         $this->createdBy $createdBy;
  74.         return $this;
  75.     }
  76.     public function getCreatedAt(): ?\DateTimeInterface
  77.     {
  78.         return $this->createdAt;
  79.     }
  80.     public function setCreatedAt(?\DateTimeInterface $createdAt): static
  81.     {
  82.         $this->createdAt $createdAt;
  83.         return $this;
  84.     }
  85.     public function getUpdatedAt(): ?\DateTimeInterface
  86.     {
  87.         return $this->updatedAt;
  88.     }
  89.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
  90.     {
  91.         $this->updatedAt $updatedAt;
  92.         return $this;
  93.     }
  94.     /**
  95.      * @return Collection<int, EventAbstract>
  96.      */
  97.     public function getEventAbstracts(): Collection
  98.     {
  99.         return $this->eventAbstracts;
  100.     }
  101.     public function addEventAbstract(EventAbstract $eventAbstract): static
  102.     {
  103.         if (!$this->eventAbstracts->contains($eventAbstract)) {
  104.             $this->eventAbstracts->add($eventAbstract);
  105.             $eventAbstract->addTheme($this);
  106.         }
  107.         return $this;
  108.     }
  109.     public function removeEventAbstract(EventAbstract $eventAbstract): static
  110.     {
  111.         if ($this->eventAbstracts->removeElement($eventAbstract)) {
  112.             if ($eventAbstract->getThemes()->contains($this)) {
  113.                 $eventAbstract->removeTheme($this);
  114.             }
  115.         }
  116.         return $this;
  117.     }
  118. }