src/Entity/Event.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\EventRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use JMS\Serializer\Annotation\Groups;
  8. #[ORM\Table(name"event")]
  9. #[ORM\Index(columns: ["title","description"], name"event",flags: ['fulltext'])]
  10. #[ORM\HasLifecycleCallbacks]
  11. #[ORM\Entity(repositoryClassEventRepository::class)]
  12. class Event
  13. {
  14.     use Timestampable;
  15.     #[ORM\Id]
  16.     #[ORM\GeneratedValue]
  17.     #[ORM\Column]
  18.     #[Groups(['getEvent'])]
  19.     private ?int $id null;
  20.     #[ORM\Column(length255)]
  21.     #[Groups(['getEvent'])]
  22.     private ?string $title null;
  23.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  24.     #[Groups(['getEvent'])]
  25.     private ?string $description null;
  26.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  27.     #[Groups(['getEvent'])]
  28.     private ?\DateTimeInterface $dayDate null;
  29.     #[ORM\Column(typeTypes::TIME_MUTABLE)]
  30.     #[Groups(['getEvent'])]
  31.     private ?\DateTimeInterface $startTime null;
  32.     #[ORM\Column(typeTypes::TIME_MUTABLE)]
  33.     #[Groups(['getEvent'])]
  34.     private ?\DateTimeInterface $endTime null;
  35.     #[ORM\ManyToOne(inversedBy'event'cascade: ["persist"])]
  36.     #[Groups(['getEvent'])]
  37.     private ?CategoryEvent $categoryEvent null;
  38.     #[ORM\ManyToOne(inversedBy'events'cascade: ["persist"])]
  39.     private ?User $author null;
  40.     #[ORM\ManyToOne(inversedBy'eventsEdited'cascade: ["persist"])]
  41.     private ?User $editor null;
  42.     #[ORM\ManyToOne(inversedBy'events'cascade: ["persist"])]
  43.     private ?School $school null;
  44.     #[ORM\ManyToOne(inversedBy'events')]
  45.     #[Groups(['getEvent'])]
  46.     private ?SchoolYear $year null;
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getTitle(): ?string
  52.     {
  53.         return $this->title;
  54.     }
  55.     public function setTitle(string $title): static
  56.     {
  57.         $this->title $title;
  58.         return $this;
  59.     }
  60.     public function getDescription(): ?string
  61.     {
  62.         return $this->description;
  63.     }
  64.     public function setDescription(?string $description): static
  65.     {
  66.         $this->description $description;
  67.         return $this;
  68.     }
  69.     public function getDayDate(): ?\DateTimeInterface
  70.     {
  71.         return $this->dayDate;
  72.     }
  73.     public function setDayDate(\DateTimeInterface $dayDate): static
  74.     {
  75.         $this->dayDate $dayDate;
  76.         return $this;
  77.     }
  78.     public function getStartTime(): ?\DateTimeInterface
  79.     {
  80.         return $this->startTime;
  81.     }
  82.     public function setStartTime(\DateTimeInterface $startTime): static
  83.     {
  84.         $this->startTime $startTime;
  85.         return $this;
  86.     }
  87.     public function getEndTime(): ?\DateTimeInterface
  88.     {
  89.         return $this->endTime;
  90.     }
  91.     public function setEndTime(\DateTimeInterface $endTime): static
  92.     {
  93.         $this->endTime $endTime;
  94.         return $this;
  95.     }
  96.     public function getCategoryEvent(): ?CategoryEvent
  97.     {
  98.         return $this->categoryEvent;
  99.     }
  100.     public function setCategoryEvent(?CategoryEvent $categoryEvent): static
  101.     {
  102.         $this->categoryEvent $categoryEvent;
  103.         return $this;
  104.     }
  105.     public function getAuthor(): ?User
  106.     {
  107.         return $this->author;
  108.     }
  109.     public function setAuthor(?User $author): static
  110.     {
  111.         $this->author $author;
  112.         return $this;
  113.     }
  114.     public function getEditor(): ?User
  115.     {
  116.         return $this->editor;
  117.     }
  118.     public function setEditor(?User $editor): static
  119.     {
  120.         $this->editor $editor;
  121.         return $this;
  122.     }
  123.     public function getSchool(): ?School
  124.     {
  125.         return $this->school;
  126.     }
  127.     public function setSchool(?School $school): static
  128.     {
  129.         $this->school $school;
  130.         return $this;
  131.     }
  132.     public function getYear(): ?SchoolYear
  133.     {
  134.         return $this->year;
  135.     }
  136.     public function setYear(?SchoolYear $year): static
  137.     {
  138.         $this->year $year;
  139.         return $this;
  140.     }
  141. }