<?phpnamespace App\Entity;use App\Repository\CycleLevelRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CycleLevelRepository::class)]class CycleLevel{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $name = null; #[ORM\Column] private ?int $level = null; #[ORM\OneToMany(mappedBy: 'cycle', targetEntity: ClassLevel::class)] private Collection $classLevels; #[ORM\OneToMany(mappedBy: 'cycleLevel', targetEntity: SchoolSection::class)] private Collection $sections; public function __construct() { $this->classLevels = new ArrayCollection(); $this->sections = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function __toString(): string { return $this->name; } public function getName(): ?string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } public function getLevel(): ?int { return $this->level; } public function setLevel(int $level): static { $this->level = $level; return $this; } /** * @return Collection<int, ClassLevel> */ public function getClassLevels(): Collection { return $this->classLevels; } public function addClassLevel(ClassLevel $classLevel): static { if (!$this->classLevels->contains($classLevel)) { $this->classLevels->add($classLevel); $classLevel->setCycle($this); } return $this; } public function removeClassLevel(ClassLevel $classLevel): static { if ($this->classLevels->removeElement($classLevel)) { // set the owning side to null (unless already changed) if ($classLevel->getCycle() === $this) { $classLevel->setCycle(null); } } return $this; } /** * @return Collection<int, SchoolSection> */ public function getSections(): Collection { return $this->sections; } public function addSection(SchoolSection $section): static { if (!$this->sections->contains($section)) { $this->sections->add($section); $section->setCycleLevel($this); } return $this; } public function removeSection(SchoolSection $section): static { if ($this->sections->removeElement($section)) { // set the owning side to null (unless already changed) if ($section->getCycleLevel() === $this) { $section->setCycleLevel(null); } } return $this; }}