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.     /**
  19.      * Nullable : ExamWeek sert aussi de "semaine générique" du programme
  20.      * (cf. ProfSchoolPlanner/ProfTime/WeekSubjectGoal, et Lesson::week),
  21.      * sans rapport avec un Exams précis dans ce cas.
  22.      */
  23.     #[ORM\ManyToOne(inversedBy'examWeeks')]
  24.     #[ORM\JoinColumn(nullabletrue)]
  25.     private ?Exams $exam null;
  26.     #[ORM\ManyToOne(inversedBy'examWeeks')]
  27.     #[ORM\JoinColumn(nullablefalse)]
  28.     private ?SchoolYear $year null;
  29.     #[ORM\Column(length255)]
  30.     private ?string $name null;
  31.     #[ORM\Column(length255)]
  32.     private ?string $nameEn null;
  33.     #[ORM\OneToMany(mappedBy'examWeek'targetEntityWeekSubjectGoal::class)]
  34.     private Collection $weekSubjectGoals;
  35.     #[ORM\OneToMany(mappedBy'week'targetEntityProfSchoolPlanner::class)]
  36.     private Collection $profSchoolPlanners;
  37.     #[ORM\OneToMany(mappedBy'week'targetEntityProfTime::class)]
  38.     private Collection $profTimes;
  39.     public function __construct()
  40.     {
  41.         $this->weekSubjectGoals = new ArrayCollection();
  42.         $this->profSchoolPlanners = new ArrayCollection();
  43.         $this->profTimes = new ArrayCollection();
  44.     }
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getStartAt(): ?\DateTimeImmutable
  50.     {
  51.         return $this->startAt;
  52.     }
  53.     public function setStartAt(\DateTimeImmutable $startAt): static
  54.     {
  55.         $this->startAt $startAt;
  56.         return $this;
  57.     }
  58.     public function getEndAt(): ?\DateTimeImmutable
  59.     {
  60.         return $this->endAt;
  61.     }
  62.     public function setEndAt(\DateTimeImmutable $endAt): static
  63.     {
  64.         $this->endAt $endAt;
  65.         return $this;
  66.     }
  67.     public function getExam(): ?Exams
  68.     {
  69.         return $this->exam;
  70.     }
  71.     public function setExam(?Exams $exam): static
  72.     {
  73.         $this->exam $exam;
  74.         return $this;
  75.     }
  76.     public function getYear(): ?SchoolYear
  77.     {
  78.         return $this->year;
  79.     }
  80.     public function setYear(?SchoolYear $year): static
  81.     {
  82.         $this->year $year;
  83.         return $this;
  84.     }
  85.     public function getName(): ?string
  86.     {
  87.         return $this->name;
  88.     }
  89.     public function setName(string $name): static
  90.     {
  91.         $this->name $name;
  92.         return $this;
  93.     }
  94.     public function getNameEn(): ?string
  95.     {
  96.         return $this->nameEn;
  97.     }
  98.     public function setNameEn(string $nameEn): static
  99.     {
  100.         $this->nameEn $nameEn;
  101.         return $this;
  102.     }
  103.     /**
  104.      * @return Collection<int, WeekSubjectGoal>
  105.      */
  106.     public function getWeekSubjectGoals(): Collection
  107.     {
  108.         return $this->weekSubjectGoals;
  109.     }
  110.     public function addWeekSubjectGoal(WeekSubjectGoal $weekSubjectGoal): static
  111.     {
  112.         if (!$this->weekSubjectGoals->contains($weekSubjectGoal)) {
  113.             $this->weekSubjectGoals->add($weekSubjectGoal);
  114.             $weekSubjectGoal->setExamWeek($this);
  115.         }
  116.         return $this;
  117.     }
  118.     public function removeWeekSubjectGoal(WeekSubjectGoal $weekSubjectGoal): static
  119.     {
  120.         if ($this->weekSubjectGoals->removeElement($weekSubjectGoal)) {
  121.             // set the owning side to null (unless already changed)
  122.             if ($weekSubjectGoal->getExamWeek() === $this) {
  123.                 $weekSubjectGoal->setExamWeek(null);
  124.             }
  125.         }
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return Collection<int, ProfSchoolPlanner>
  130.      */
  131.     public function getProfSchoolPlanners(): Collection
  132.     {
  133.         return $this->profSchoolPlanners;
  134.     }
  135.     public function addProfSchoolPlanner(ProfSchoolPlanner $profSchoolPlanner): static
  136.     {
  137.         if (!$this->profSchoolPlanners->contains($profSchoolPlanner)) {
  138.             $this->profSchoolPlanners->add($profSchoolPlanner);
  139.             $profSchoolPlanner->setWeek($this);
  140.         }
  141.         return $this;
  142.     }
  143.     public function removeProfSchoolPlanner(ProfSchoolPlanner $profSchoolPlanner): static
  144.     {
  145.         if ($this->profSchoolPlanners->removeElement($profSchoolPlanner)) {
  146.             // set the owning side to null (unless already changed)
  147.             if ($profSchoolPlanner->getWeek() === $this) {
  148.                 $profSchoolPlanner->setWeek(null);
  149.             }
  150.         }
  151.         return $this;
  152.     }
  153.     /**
  154.      * @return Collection<int, ProfTime>
  155.      */
  156.     public function getProfTimes(): Collection
  157.     {
  158.         return $this->profTimes;
  159.     }
  160.     public function addProfTime(ProfTime $profTime): static
  161.     {
  162.         if (!$this->profTimes->contains($profTime)) {
  163.             $this->profTimes->add($profTime);
  164.             $profTime->setWeek($this);
  165.         }
  166.         return $this;
  167.     }
  168.     public function removeProfTime(ProfTime $profTime): static
  169.     {
  170.         if ($this->profTimes->removeElement($profTime)) {
  171.             // set the owning side to null (unless already changed)
  172.             if ($profTime->getWeek() === $this) {
  173.                 $profTime->setWeek(null);
  174.             }
  175.         }
  176.         return $this;
  177.     }
  178. }