<?phpnamespace App\Entity;use App\Repository\ExamWeekRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ExamWeekRepository::class)]class ExamWeek{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column] private ?\DateTimeImmutable $startAt = null; #[ORM\Column] private ?\DateTimeImmutable $endAt = null; #[ORM\ManyToOne(inversedBy: 'examWeeks')] #[ORM\JoinColumn(nullable: false)] private ?Exams $exam = null; #[ORM\ManyToOne(inversedBy: 'examWeeks')] #[ORM\JoinColumn(nullable: false)] private ?SchoolYear $year = null; #[ORM\Column(length: 255)] private ?string $name = null; #[ORM\Column(length: 255)] private ?string $nameEn = null; #[ORM\OneToMany(mappedBy: 'examWeek', targetEntity: WeekSubjectGoal::class)] private Collection $weekSubjectGoals; #[ORM\OneToMany(mappedBy: 'week', targetEntity: ProfSchoolPlanner::class)] private Collection $profSchoolPlanners; #[ORM\OneToMany(mappedBy: 'week', targetEntity: ProfTime::class)] private Collection $profTimes; public function __construct() { $this->weekSubjectGoals = new ArrayCollection(); $this->profSchoolPlanners = new ArrayCollection(); $this->profTimes = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getStartAt(): ?\DateTimeImmutable { return $this->startAt; } public function setStartAt(\DateTimeImmutable $startAt): static { $this->startAt = $startAt; return $this; } public function getEndAt(): ?\DateTimeImmutable { return $this->endAt; } public function setEndAt(\DateTimeImmutable $endAt): static { $this->endAt = $endAt; return $this; } public function getExam(): ?Exams { return $this->exam; } public function setExam(?Exams $exam): static { $this->exam = $exam; return $this; } public function getYear(): ?SchoolYear { return $this->year; } public function setYear(?SchoolYear $year): static { $this->year = $year; return $this; } public function getName(): ?string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } public function getNameEn(): ?string { return $this->nameEn; } public function setNameEn(string $nameEn): static { $this->nameEn = $nameEn; return $this; } /** * @return Collection<int, WeekSubjectGoal> */ public function getWeekSubjectGoals(): Collection { return $this->weekSubjectGoals; } public function addWeekSubjectGoal(WeekSubjectGoal $weekSubjectGoal): static { if (!$this->weekSubjectGoals->contains($weekSubjectGoal)) { $this->weekSubjectGoals->add($weekSubjectGoal); $weekSubjectGoal->setExamWeek($this); } return $this; } public function removeWeekSubjectGoal(WeekSubjectGoal $weekSubjectGoal): static { if ($this->weekSubjectGoals->removeElement($weekSubjectGoal)) { // set the owning side to null (unless already changed) if ($weekSubjectGoal->getExamWeek() === $this) { $weekSubjectGoal->setExamWeek(null); } } return $this; } /** * @return Collection<int, ProfSchoolPlanner> */ public function getProfSchoolPlanners(): Collection { return $this->profSchoolPlanners; } public function addProfSchoolPlanner(ProfSchoolPlanner $profSchoolPlanner): static { if (!$this->profSchoolPlanners->contains($profSchoolPlanner)) { $this->profSchoolPlanners->add($profSchoolPlanner); $profSchoolPlanner->setWeek($this); } return $this; } public function removeProfSchoolPlanner(ProfSchoolPlanner $profSchoolPlanner): static { if ($this->profSchoolPlanners->removeElement($profSchoolPlanner)) { // set the owning side to null (unless already changed) if ($profSchoolPlanner->getWeek() === $this) { $profSchoolPlanner->setWeek(null); } } return $this; } /** * @return Collection<int, ProfTime> */ public function getProfTimes(): Collection { return $this->profTimes; } public function addProfTime(ProfTime $profTime): static { if (!$this->profTimes->contains($profTime)) { $this->profTimes->add($profTime); $profTime->setWeek($this); } return $this; } public function removeProfTime(ProfTime $profTime): static { if ($this->profTimes->removeElement($profTime)) { // set the owning side to null (unless already changed) if ($profTime->getWeek() === $this) { $profTime->setWeek(null); } } return $this; }}