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.     private ?SchoolYear $year null;
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getTitle(): ?string
  51.     {
  52.         return $this->title;
  53.     }
  54.     public function setTitle(string $title): static
  55.     {
  56.         $this->title $title;
  57.         return $this;
  58.     }
  59.     public function getDescription(): ?string
  60.     {
  61.         return $this->description;
  62.     }
  63.     public function setDescription(?string $description): static
  64.     {
  65.         $this->description $description;
  66.         return $this;
  67.     }
  68.     public function getDayDate(): ?\DateTimeInterface
  69.     {
  70.         return $this->dayDate;
  71.     }
  72.     public function setDayDate(\DateTimeInterface $dayDate): static
  73.     {
  74.         $this->dayDate $dayDate;
  75.         return $this;
  76.     }
  77.     public function getStartTime(): ?\DateTimeInterface
  78.     {
  79.         return $this->startTime;
  80.     }
  81.     public function setStartTime(\DateTimeInterface $startTime): static
  82.     {
  83.         $this->startTime $startTime;
  84.         return $this;
  85.     }
  86.     public function getEndTime(): ?\DateTimeInterface
  87.     {
  88.         return $this->endTime;
  89.     }
  90.     public function setEndTime(\DateTimeInterface $endTime): static
  91.     {
  92.         $this->endTime $endTime;
  93.         return $this;
  94.     }
  95.     public function getCategoryEvent(): ?CategoryEvent
  96.     {
  97.         return $this->categoryEvent;
  98.     }
  99.     public function setCategoryEvent(?CategoryEvent $categoryEvent): static
  100.     {
  101.         $this->categoryEvent $categoryEvent;
  102.         return $this;
  103.     }
  104.     public function getAuthor(): ?User
  105.     {
  106.         return $this->author;
  107.     }
  108.     public function setAuthor(?User $author): static
  109.     {
  110.         $this->author $author;
  111.         return $this;
  112.     }
  113.     public function getEditor(): ?User
  114.     {
  115.         return $this->editor;
  116.     }
  117.     public function setEditor(?User $editor): static
  118.     {
  119.         $this->editor $editor;
  120.         return $this;
  121.     }
  122.     public function getSchool(): ?School
  123.     {
  124.         return $this->school;
  125.     }
  126.     public function setSchool(?School $school): static
  127.     {
  128.         $this->school $school;
  129.         return $this;
  130.     }
  131.     public function getYear(): ?SchoolYear
  132.     {
  133.         return $this->year;
  134.     }
  135.     public function setYear(?SchoolYear $year): static
  136.     {
  137.         $this->year $year;
  138.         return $this;
  139.     }
  140. }