src/Entity/ExamWeek.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ExamWeekRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassExamWeekRepository::class)]
  8. class ExamWeek
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column]
  15.     private ?\DateTimeImmutable $startAt null;
  16.     #[ORM\Column]
  17.     private ?\DateTimeImmutable $endAt null;
  18.     #[ORM\ManyToOne(inversedBy'examWeeks')]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?Exams $exam null;
  21.     #[ORM\ManyToOne(inversedBy'examWeeks')]
  22.     #[ORM\JoinColumn(nullablefalse)]
  23.     private ?SchoolYear $year null;
  24.     #[ORM\Column(length255)]
  25.     private ?string $name null;
  26.     #[ORM\Column(length255)]
  27.     private ?string $nameEn null;
  28.     #[ORM\OneToMany(mappedBy'examWeek'targetEntityWeekSubjectGoal::class)]
  29.     private Collection $weekSubjectGoals;
  30.     #[ORM\OneToMany(mappedBy'week'targetEntityProfSchoolPlanner::class)]
  31.     private Collection $profSchoolPlanners;
  32.     #[ORM\OneToMany(mappedBy'week'targetEntityProfTime::class)]
  33.     private Collection $profTimes;
  34.     public function __construct()
  35.     {
  36.         $this->weekSubjectGoals = new ArrayCollection();
  37.         $this->profSchoolPlanners = new ArrayCollection();
  38.         $this->profTimes = new ArrayCollection();
  39.     }
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getStartAt(): ?\DateTimeImmutable
  45.     {
  46.         return $this->startAt;
  47.     }
  48.     public function setStartAt(\DateTimeImmutable $startAt): static
  49.     {
  50.         $this->startAt $startAt;
  51.         return $this;
  52.     }
  53.     public function getEndAt(): ?\DateTimeImmutable
  54.     {
  55.         return $this->endAt;
  56.     }
  57.     public function setEndAt(\DateTimeImmutable $endAt): static
  58.     {
  59.         $this->endAt $endAt;
  60.         return $this;
  61.     }
  62.     public function getExam(): ?Exams
  63.     {
  64.         return $this->exam;
  65.     }
  66.     public function setExam(?Exams $exam): static
  67.     {
  68.         $this->exam $exam;
  69.         return $this;
  70.     }
  71.     public function getYear(): ?SchoolYear
  72.     {
  73.         return $this->year;
  74.     }
  75.     public function setYear(?SchoolYear $year): static
  76.     {
  77.         $this->year $year;
  78.         return $this;
  79.     }
  80.     public function getName(): ?string
  81.     {
  82.         return $this->name;
  83.     }
  84.     public function setName(string $name): static
  85.     {
  86.         $this->name $name;
  87.         return $this;
  88.     }
  89.     public function getNameEn(): ?string
  90.     {
  91.         return $this->nameEn;
  92.     }
  93.     public function setNameEn(string $nameEn): static
  94.     {
  95.         $this->nameEn $nameEn;
  96.         return $this;
  97.     }
  98.     /**
  99.      * @return Collection<int, WeekSubjectGoal>
  100.      */
  101.     public function getWeekSubjectGoals(): Collection
  102.     {
  103.         return $this->weekSubjectGoals;
  104.     }
  105.     public function addWeekSubjectGoal(WeekSubjectGoal $weekSubjectGoal): static
  106.     {
  107.         if (!$this->weekSubjectGoals->contains($weekSubjectGoal)) {
  108.             $this->weekSubjectGoals->add($weekSubjectGoal);
  109.             $weekSubjectGoal->setExamWeek($this);
  110.         }
  111.         return $this;
  112.     }
  113.     public function removeWeekSubjectGoal(WeekSubjectGoal $weekSubjectGoal): static
  114.     {
  115.         if ($this->weekSubjectGoals->removeElement($weekSubjectGoal)) {
  116.             // set the owning side to null (unless already changed)
  117.             if ($weekSubjectGoal->getExamWeek() === $this) {
  118.                 $weekSubjectGoal->setExamWeek(null);
  119.             }
  120.         }
  121.         return $this;
  122.     }
  123.     /**
  124.      * @return Collection<int, ProfSchoolPlanner>
  125.      */
  126.     public function getProfSchoolPlanners(): Collection
  127.     {
  128.         return $this->profSchoolPlanners;
  129.     }
  130.     public function addProfSchoolPlanner(ProfSchoolPlanner $profSchoolPlanner): static
  131.     {
  132.         if (!$this->profSchoolPlanners->contains($profSchoolPlanner)) {
  133.             $this->profSchoolPlanners->add($profSchoolPlanner);
  134.             $profSchoolPlanner->setWeek($this);
  135.         }
  136.         return $this;
  137.     }
  138.     public function removeProfSchoolPlanner(ProfSchoolPlanner $profSchoolPlanner): static
  139.     {
  140.         if ($this->profSchoolPlanners->removeElement($profSchoolPlanner)) {
  141.             // set the owning side to null (unless already changed)
  142.             if ($profSchoolPlanner->getWeek() === $this) {
  143.                 $profSchoolPlanner->setWeek(null);
  144.             }
  145.         }
  146.         return $this;
  147.     }
  148.     /**
  149.      * @return Collection<int, ProfTime>
  150.      */
  151.     public function getProfTimes(): Collection
  152.     {
  153.         return $this->profTimes;
  154.     }
  155.     public function addProfTime(ProfTime $profTime): static
  156.     {
  157.         if (!$this->profTimes->contains($profTime)) {
  158.             $this->profTimes->add($profTime);
  159.             $profTime->setWeek($this);
  160.         }
  161.         return $this;
  162.     }
  163.     public function removeProfTime(ProfTime $profTime): static
  164.     {
  165.         if ($this->profTimes->removeElement($profTime)) {
  166.             // set the owning side to null (unless already changed)
  167.             if ($profTime->getWeek() === $this) {
  168.                 $profTime->setWeek(null);
  169.             }
  170.         }
  171.         return $this;
  172.     }
  173. }