src/Entity/AgendaElement.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\AgendaElementRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use JMS\Serializer\Annotation\Groups;
  10. #[ORM\HasLifecycleCallbacks]
  11. #[ORM\Entity(repositoryClassAgendaElementRepository::class)]
  12. class AgendaElement
  13. {
  14.     use Timestampable;
  15.     
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     #[Groups(['getAgenda'])]
  20.     private ?int $id null;
  21.     #[ORM\Column(typeTypes::TIME_MUTABLE)]
  22.     #[Groups(['getAgenda'])]
  23.     private ?\DateTimeInterface $startAt null;
  24.     #[ORM\Column(typeTypes::TIME_MUTABLE)]
  25.     #[Groups(['getAgenda'])]
  26.     private ?\DateTimeInterface $endAt null;
  27.     #[ORM\Column(length255)]
  28.     #[Groups(['getAgenda'])]
  29.     private ?float $duration null;
  30.     #[ORM\Column(length255nullabletrue)]
  31.     #[Groups(['getAgenda'])]
  32.     private ?int $other null;
  33.     #[ORM\ManyToOne(inversedBy'agendaElements')]
  34.     #[Groups(['getAgenda'])]
  35.     private ?Subject $subject null;
  36.     #[ORM\ManyToOne(inversedBy'elements')]
  37.     #[ORM\JoinColumn(nullablefalse)]
  38.     private ?AgendaDay $agendaDay null;
  39.     #[ORM\ManyToOne(inversedBy'agendaElements')]
  40.     #[ORM\JoinColumn(nullablefalse)]
  41.     private ?User $author null;
  42.     #[ORM\Column]
  43.     private ?bool $active null;
  44.     #[ORM\Column(nullabletrue)]
  45.     private ?\DateTimeImmutable $descativatedAt null;
  46.     #[ORM\OneToMany(mappedBy'agendaElement'targetEntityProfTime::class)]
  47.     private Collection $profTimes;
  48.     #[ORM\ManyToOne(inversedBy'agendaElements')]
  49.     #[ORM\JoinColumn(nullablefalse)]
  50.     private ?School $school null;
  51.     #[ORM\ManyToOne(inversedBy'agendaElements')]
  52.     #[ORM\JoinColumn(nullablefalse)]
  53.     private ?SchoolYear $year null;
  54.     #[ORM\ManyToOne(inversedBy'agendaElements')]
  55.     #[ORM\JoinColumn(nullablefalse)]
  56.     private ?TheClass $classe null;
  57.     public function __construct()
  58.     {
  59.         $this->profTimes = new ArrayCollection();
  60.     }
  61.     public function __toString()
  62.     {
  63.         return $this->id;
  64.     }
  65.     public function getId(): ?int
  66.     {
  67.         return $this->id;
  68.     }
  69.     public function getStartAt(): ?\DateTimeInterface
  70.     {
  71.         return $this->startAt;
  72.     }
  73.     public function setStartAt(\DateTimeInterface $startAt): static
  74.     {
  75.         $this->startAt $startAt;
  76.         return $this;
  77.     }
  78.     public function getEndAt(): ?\DateTimeInterface
  79.     {
  80.         return $this->endAt;
  81.     }
  82.     public function setEndAt(\DateTimeInterface $endAt): static
  83.     {
  84.         $this->endAt $endAt;
  85.         return $this;
  86.     }
  87.     public function getDuration(): ?float
  88.     {
  89.         return $this->duration;
  90.     }
  91.     public function setDuration(float $duration): static
  92.     {
  93.         $this->duration $duration;
  94.         return $this;
  95.     }
  96.     public function getOther(): ?int
  97.     {
  98.         return $this->other;
  99.     }
  100.     public function setOther(?int $other): static
  101.     {
  102.         $this->other $other;
  103.         return $this;
  104.     }
  105.     public function getSubject(): ?Subject
  106.     {
  107.         return $this->subject;
  108.     }
  109.     public function setSubject(?Subject $subject): static
  110.     {
  111.         $this->subject $subject;
  112.         return $this;
  113.     }
  114.     public function getAgendaDay(): ?AgendaDay
  115.     {
  116.         return $this->agendaDay;
  117.     }
  118.     public function setAgendaDay(?AgendaDay $agendaDay): static
  119.     {
  120.         $this->agendaDay $agendaDay;
  121.         return $this;
  122.     }
  123.     public function getAuthor(): ?User
  124.     {
  125.         return $this->author;
  126.     }
  127.     public function setAuthor(?User $author): static
  128.     {
  129.         $this->author $author;
  130.         return $this;
  131.     }
  132.     public function isActive(): ?bool
  133.     {
  134.         return $this->active;
  135.     }
  136.     public function setActive(bool $active): static
  137.     {
  138.         $this->active $active;
  139.         return $this;
  140.     }
  141.     public function getDescativatedAt(): ?\DateTimeImmutable
  142.     {
  143.         return $this->descativatedAt;
  144.     }
  145.     public function setDescativatedAt(?\DateTimeImmutable $descativatedAt): static
  146.     {
  147.         $this->descativatedAt $descativatedAt;
  148.         return $this;
  149.     }
  150.     /**
  151.      * @return Collection<int, ProfTime>
  152.      */
  153.     public function getProfTimes(): Collection
  154.     {
  155.         return $this->profTimes;
  156.     }
  157.     public function addProfTime(ProfTime $profTime): static
  158.     {
  159.         if (!$this->profTimes->contains($profTime)) {
  160.             $this->profTimes->add($profTime);
  161.             $profTime->setAgendaElement($this);
  162.         }
  163.         return $this;
  164.     }
  165.     public function removeProfTime(ProfTime $profTime): static
  166.     {
  167.         if ($this->profTimes->removeElement($profTime)) {
  168.             // set the owning side to null (unless already changed)
  169.             if ($profTime->getAgendaElement() === $this) {
  170.                 $profTime->setAgendaElement(null);
  171.             }
  172.         }
  173.         return $this;
  174.     }
  175.     public function getSchool(): ?School
  176.     {
  177.         return $this->school;
  178.     }
  179.     public function setSchool(?School $school): static
  180.     {
  181.         $this->school $school;
  182.         return $this;
  183.     }
  184.     public function getYear(): ?SchoolYear
  185.     {
  186.         return $this->year;
  187.     }
  188.     public function setYear(?SchoolYear $year): static
  189.     {
  190.         $this->year $year;
  191.         return $this;
  192.     }
  193.     public function getClasse(): ?TheClass
  194.     {
  195.         return $this->classe;
  196.     }
  197.     public function setClasse(?TheClass $classe): static
  198.     {
  199.         $this->classe $classe;
  200.         return $this;
  201.     }
  202. }