src/Entity/TheClass.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TheClassRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use JMS\Serializer\Annotation\Groups;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. use App\Entity\Traits\Timestampable;
  10. #[ORM\HasLifecycleCallbacks]
  11. #[ORM\Entity(repositoryClassTheClassRepository::class)]
  12. class TheClass
  13. {
  14.     use Timestampable;
  15.     #[ORM\Id]
  16.     #[ORM\GeneratedValue]
  17.     #[ORM\Column]
  18.     #[Groups(['homework','note','getStudents','getSubject','getClass','getDiscussionClass','getExamStudent','getStatsStudentParentIndex'])]
  19.     private ?int $id null;
  20.     #[ORM\Column(length255)]
  21.     #[Groups(['homework','getLate','note','getStudents','getClass','getDiscussionClass','getDiscussion','getExamStudent','getAbsence','getPunish','getStatsStudentParentIndex'])]
  22.     private ?string $name null;
  23.     #[ORM\ManyToOne(cascade: ["persist"], inversedBy'theClasses')]
  24.     #[ORM\JoinColumn(nullablefalse)]
  25.     private ?SchoolSection $section null;
  26.     #[ORM\OneToMany(mappedBy'classe'targetEntityStudentYear::class)]
  27.     private Collection $studentsYears;
  28.     #[ORM\OneToMany(mappedBy'classe'targetEntitySubject::class)]
  29.     private Collection $subjects;
  30.     #[ORM\OneToMany(mappedBy'classe'targetEntityHomeWork::class)]
  31.     private Collection $homeWorks;
  32.     #[ORM\Column(nullabletrue)]
  33.     private ?bool $active null;
  34.     #[ORM\OneToMany(mappedBy'classe'targetEntityNote::class)]
  35.     private Collection $notes;
  36.     #[ORM\ManyToMany(targetEntityUserYear::class, mappedBy'classes')]
  37.     private Collection $userYears;
  38.     #[ORM\ManyToMany(targetEntityDocInfo::class, mappedBy'classes'cascade: ['persist''remove'])]
  39.     private Collection $docInfos;
  40.     #[ORM\ManyToOne(cascade: ["persist"], inversedBy'theClasses')]
  41.     private ?User $author null;
  42.     #[ORM\ManyToOne(cascade: ["persist"], inversedBy'theClassesEdited')]
  43.     private ?User $editor null;
  44.     #[ORM\ManyToOne(cascade: ["persist"], inversedBy'theClasses')]
  45.     #[Groups(['getClass'])]
  46.     private ?School $school null;
  47.     #[ORM\OneToMany(mappedBy'classe'targetEntityDiscussionClass::class)]
  48.     private Collection $discussionClasses;
  49.     #[ORM\OneToMany(mappedBy'classe'targetEntitySubjectGroup::class, orphanRemovaltrue)]
  50.     private Collection $subjectGroups;
  51.     #[ORM\OneToMany(mappedBy'classe'targetEntityScolarity::class, orphanRemovaltrue)]
  52.     private Collection $scolarities;
  53.     #[ORM\OneToMany(mappedBy'classe'targetEntityExamAgenda::class)]
  54.     private Collection $examAgendas;
  55.     #[ORM\OneToMany(mappedBy'classe'targetEntitySubSequence::class, orphanRemovaltrue)]
  56.     private Collection $subSequences;
  57.     #[ORM\OneToMany(mappedBy'classe'targetEntityQuarter::class, orphanRemovaltrue)]
  58.     private Collection $quarters;
  59.     #[ORM\OneToMany(mappedBy'classe'targetEntitySubNote::class, orphanRemovaltrue)]
  60.     private Collection $subNotes;
  61.     #[ORM\OneToMany(mappedBy'classe'targetEntityPunish::class)]
  62.     private Collection $punishes;
  63.     #[ORM\OneToMany(mappedBy'classe'targetEntityDisciplineWarning::class)]
  64.     private Collection $disciplineWarnings;
  65.     #[ORM\OneToMany(mappedBy'classe'targetEntityDisciplineBlame::class)]
  66.     private Collection $disciplineBlames;
  67.     #[ORM\OneToMany(mappedBy'classe'targetEntityDisciplineExclusion::class)]
  68.     private Collection $disciplineExclusions;
  69.     #[ORM\OneToMany(mappedBy'classe'targetEntityParentNote::class)]
  70.     private Collection $parentNotes;
  71.     #[ORM\OneToMany(mappedBy'classe'targetEntityAbsence::class)]
  72.     private Collection $absences;
  73.     #[ORM\OneToMany(mappedBy'classe'targetEntityDisciplineRetained::class)]
  74.     private Collection $disciplineRetaineds;
  75.     #[ORM\ManyToOne(inversedBy'theClassesTeached')]
  76.     private ?User $prof null;
  77.     #[ORM\OneToMany(mappedBy'classe'targetEntityPrimaryParentNote::class)]
  78.     private Collection $primaryParentNotes;
  79.     #[ORM\OneToMany(mappedBy'classe'targetEntityPrimaryNote::class)]
  80.     private Collection $primaryNotes;
  81.     #[ORM\OneToMany(mappedBy'classe'targetEntityDisciplinePunish::class)]
  82.     private Collection $disciplinePunishes;
  83.     #[ORM\OneToMany(mappedBy'classe'targetEntityLate::class)]
  84.     private Collection $lates;
  85.     #[ORM\OneToMany(mappedBy'classe'targetEntityBlame::class)]
  86.     private Collection $blames;
  87.     #[ORM\OneToMany(mappedBy'classe'targetEntityWarning::class)]
  88.     private Collection $warnings;
  89.     #[ORM\OneToMany(mappedBy'classe'targetEntityRetained::class)]
  90.     private Collection $retaineds;
  91.     #[ORM\Column(length255nullabletrue)]
  92.     private ?string $slug null;
  93.     #[ORM\OneToMany(mappedBy'classe'targetEntityDisciplineConcile::class)]
  94.     private Collection $disciplineConciles;
  95.     #[ORM\ManyToOne(inversedBy'principalClasses')]
  96.     private ?UserYear $principalProf null;
  97.     #[ORM\OneToMany(mappedBy'classe'targetEntityCompetence::class)]
  98.     private Collection $competences;
  99.     #[ORM\OneToMany(mappedBy'classe'targetEntityWeekSubjectGoal::class)]
  100.     private Collection $weekSubjectGoals;
  101.     #[ORM\OneToMany(mappedBy'classe'targetEntityAgendaElement::class)]
  102.     private Collection $agendaElements;
  103.     #[ORM\ManyToOne(inversedBy'classes')]
  104.     private ?ClassLevel $classLevel null;
  105.     #[ORM\ManyToMany(targetEntityClassOption::class, inversedBy'theClasses')]
  106.     #[ORM\JoinTable(name'the_class_class_option')]
  107.     private Collection $classOptions;
  108.     #[ORM\ManyToMany(targetEntityTheClass::class)]
  109.     #[ORM\JoinTable(
  110.         name'class_next_class',
  111.         joinColumns: [new ORM\JoinColumn(name'class_id'referencedColumnName'id')],
  112.         inverseJoinColumns: [new ORM\JoinColumn(name'next_class_id'referencedColumnName'id')]
  113.     )]
  114.     private Collection $nextClasses;
  115.     public function __toString(): string
  116.     {
  117.         return $this->name;
  118.     }
  119.     public function __construct()
  120.     {
  121.         $this->subjects = new ArrayCollection();
  122.         $this->studentsYears = new ArrayCollection();
  123.         $this->homeWorks = new ArrayCollection();
  124.         $this->notes = new ArrayCollection();
  125.         $this->userYears = new ArrayCollection();
  126.         $this->docInfos = new ArrayCollection();
  127.         $this->discussionClasses = new ArrayCollection();
  128.         $this->subjectGroups = new ArrayCollection();
  129.         $this->scolarities = new ArrayCollection();
  130.         $this->subSequences = new ArrayCollection();
  131.         $this->quarters = new ArrayCollection();
  132.         $this->subNotes = new ArrayCollection();
  133.         $this->disciplineWarnings = new ArrayCollection();
  134.         $this->disciplineBlames = new ArrayCollection();
  135.         $this->disciplineExclusions = new ArrayCollection();
  136.         $this->parentNotes = new ArrayCollection();
  137.         $this->absences = new ArrayCollection();
  138.         $this->disciplineRetaineds = new ArrayCollection();
  139.         $this->primaryParentNotes = new ArrayCollection();
  140.         $this->primaryNotes = new ArrayCollection();
  141.         $this->punishes = new ArrayCollection();
  142.         $this->disciplinePunishes = new ArrayCollection();
  143.         $this->lates = new ArrayCollection();
  144.         $this->blames = new ArrayCollection();
  145.         $this->warnings = new ArrayCollection();
  146.         $this->retaineds = new ArrayCollection();
  147.         $this->disciplineConciles = new ArrayCollection();
  148.         $this->competences = new ArrayCollection();
  149.         $this->weekSubjectGoals = new ArrayCollection();
  150.         $this->agendaElements = new ArrayCollection();
  151.         $this->classOptions   = new ArrayCollection();
  152.         $this->nextClasses    = new ArrayCollection();
  153.     }
  154.     public function getId(): ?int
  155.     {
  156.         return $this->id;
  157.     }
  158.     public function getName(): ?string
  159.     {
  160.         return $this->name;
  161.     }
  162.     public function setName(string $name): static
  163.     {
  164.         $this->name $name;
  165.         return $this;
  166.     }
  167.     public function getSection(): ?SchoolSection
  168.     {
  169.         return $this->section;
  170.     }
  171.     public function setSection(?SchoolSection $section): static
  172.     {
  173.         $this->section $section;
  174.         return $this;
  175.     }
  176.     /**
  177.      * @return Collection<int, StudentYear>
  178.      */
  179.     public function getStudentsYears(): Collection
  180.     {
  181.         return $this->studentsYears;
  182.     }
  183.     public function addStudentsYear(StudentYear $studentsYear): static
  184.     {
  185.         if (!$this->studentsYears->contains($studentsYear)) {
  186.             $this->studentsYears->add($studentsYear);
  187.             $studentsYear->setClasse($this);
  188.         }
  189.         return $this;
  190.     }
  191.     public function removeStudentsYear(StudentYear $studentsYear): static
  192.     {
  193.         if ($this->studentsYears->removeElement($studentsYear)) {
  194.             // set the owning side to null (unless already changed)
  195.             if ($studentsYear->getClasse() === $this) {
  196.                 $studentsYear->setClasse(null);
  197.             }
  198.         }
  199.         return $this;
  200.     }
  201.     /**
  202.      * @return Collection<int, Subject>
  203.      */
  204.     public function getSubjects(): Collection
  205.     {
  206.         return $this->subjects;
  207.     }
  208.     public function addSubject(Subject $subject): static
  209.     {
  210.         if (!$this->subjects->contains($subject)) {
  211.             $this->subjects->add($subject);
  212.             $subject->setClasse($this);
  213.         }
  214.         return $this;
  215.     }
  216.     public function removeSubject(Subject $subject): static
  217.     {
  218.         if ($this->subjects->removeElement($subject)) {
  219.             // set the owning side to null (unless already changed)
  220.             if ($subject->getClasse() === $this) {
  221.                 $subject->setClasse(null);
  222.             }
  223.         }
  224.         return $this;
  225.     }
  226.     /**
  227.      * @return Collection<int, HomeWork>
  228.      */
  229.     public function getHomeWorks(): Collection
  230.     {
  231.         return $this->homeWorks;
  232.     }
  233.     public function addHomeWork(HomeWork $homeWork): static
  234.     {
  235.         if (!$this->homeWorks->contains($homeWork)) {
  236.             $this->homeWorks->add($homeWork);
  237.             $homeWork->setClasse($this);
  238.         }
  239.         return $this;
  240.     }
  241.     public function removeHomework(HomeWork $homeWork): static
  242.     {
  243.         if ($this->homeWorks->removeElement($homeWork)) {
  244.             // set the owning side to null (unless already changed)
  245.             if ($homeWork->getClasse() === $this) {
  246.                 $homeWork->setClasse(null);
  247.             }
  248.         }
  249.         return $this;
  250.     }
  251.     public function isActive(): ?bool
  252.     {
  253.         return $this->active;
  254.     }
  255.     public function setActive(?bool $active): static
  256.     {
  257.         $this->active $active;
  258.         return $this;
  259.     }
  260.     /**
  261.      * @return Collection<int, Note>
  262.      */
  263.     public function getNotes(): Collection
  264.     {
  265.         return $this->notes;
  266.     }
  267.     public function addNote(Note $note): static
  268.     {
  269.         if (!$this->notes->contains($note)) {
  270.             $this->notes->add($note);
  271.             $note->setClasse($this);
  272.         }
  273.         return $this;
  274.     }
  275.     public function removeNote(Note $note): static
  276.     {
  277.         if ($this->notes->removeElement($note)) {
  278.             // set the owning side to null (unless already changed)
  279.             if ($note->getClasse() === $this) {
  280.                 $note->setClasse(null);
  281.             }
  282.         }
  283.         return $this;
  284.     }
  285.     /**
  286.      * @return Collection<int, UserYear>
  287.      */
  288.     public function getUserYears(): Collection
  289.     {
  290.         return $this->userYears;
  291.     }
  292.     public function addUserYear(UserYear $userYear): static
  293.     {
  294.         if (!$this->userYears->contains($userYear)) {
  295.             $this->userYears->add($userYear);
  296.             $userYear->addClass($this);
  297.         }
  298.         return $this;
  299.     }
  300.     public function removeUserYear(UserYear $userYear): static
  301.     {
  302.         if ($this->userYears->removeElement($userYear)) {
  303.             $userYear->removeClass($this);
  304.         }
  305.         return $this;
  306.     }
  307.     /**
  308.      * @return Collection<int, DocInfo>
  309.      */
  310.     public function getDocInfos(): Collection
  311.     {
  312.         return $this->docInfos;
  313.     }
  314.     public function addDocInfo(DocInfo $docInfo): static
  315.     {
  316.         if (!$this->docInfos->contains($docInfo)) {
  317.             $this->docInfos->add($docInfo);
  318.             $docInfo->addClass($this);
  319.         }
  320.         return $this;
  321.     }
  322.     public function removeDocInfo(DocInfo $docInfo): static
  323.     {
  324.         if ($this->docInfos->removeElement($docInfo)) {
  325.             $docInfo->removeClass($this);
  326.         }
  327.         return $this;
  328.     }
  329.     public function getAuthor(): ?User
  330.     {
  331.         return $this->author;
  332.     }
  333.     public function setAuthor(?User $author): static
  334.     {
  335.         $this->author $author;
  336.         return $this;
  337.     }
  338.     public function getEditor(): ?User
  339.     {
  340.         return $this->editor;
  341.     }
  342.     public function setEditor(?User $editor): static
  343.     {
  344.         $this->editor $editor;
  345.         return $this;
  346.     }
  347.     public function getSchool(): ?School
  348.     {
  349.         return $this->school;
  350.     }
  351.     public function setSchool(?School $school): static
  352.     {
  353.         $this->school $school;
  354.         return $this;
  355.     }
  356.     /**
  357.      * @return Collection<int, DiscussionClass>
  358.      */
  359.     public function getDiscussionClasses(): Collection
  360.     {
  361.         return $this->discussionClasses;
  362.     }
  363.     public function addDiscussionClass(DiscussionClass $discussionClass): static
  364.     {
  365.         if (!$this->discussionClasses->contains($discussionClass)) {
  366.             $this->discussionClasses->add($discussionClass);
  367.             $discussionClass->setClasse($this);
  368.         }
  369.         return $this;
  370.     }
  371.     public function removeDiscussionClass(DiscussionClass $discussionClass): static
  372.     {
  373.         if ($this->discussionClasses->removeElement($discussionClass)) {
  374.             // set the owning side to null (unless already changed)
  375.             if ($discussionClass->getClasse() === $this) {
  376.                 $discussionClass->setClasse(null);
  377.             }
  378.         }
  379.         return $this;
  380.     }
  381.     /**
  382.      * @return Collection<int, SubjectGroup>
  383.      */
  384.     public function getSubjectGroups(): Collection
  385.     {
  386.         return $this->subjectGroups;
  387.     }
  388.     public function addSubjectGroup(SubjectGroup $subjectGroup): static
  389.     {
  390.         if (!$this->subjectGroups->contains($subjectGroup)) {
  391.             $this->subjectGroups->add($subjectGroup);
  392.             $subjectGroup->setClasse($this);
  393.         }
  394.         return $this;
  395.     }
  396.     public function removeSubjectGroup(SubjectGroup $subjectGroup): static
  397.     {
  398.         if ($this->subjectGroups->removeElement($subjectGroup)) {
  399.             // set the owning side to null (unless already changed)
  400.             if ($subjectGroup->getClasse() === $this) {
  401.                 $subjectGroup->setClasse(null);
  402.             }
  403.         }
  404.         return $this;
  405.     }
  406.     /**
  407.      * @return Collection<int, Scolarity>
  408.      */
  409.     public function getScolarities(): Collection
  410.     {
  411.         return $this->scolarities;
  412.     }
  413.     public function addScolarity(Scolarity $scolarity): static
  414.     {
  415.         if (!$this->scolarities->contains($scolarity)) {
  416.             $this->scolarities->add($scolarity);
  417.             $scolarity->setClasse($this);
  418.         }
  419.         return $this;
  420.     }
  421.     public function removeScolarity(Scolarity $scolarity): static
  422.     {
  423.         if ($this->scolarities->removeElement($scolarity)) {
  424.             // set the owning side to null (unless already changed)
  425.             if ($scolarity->getClasse() === $this) {
  426.                 $scolarity->setClasse(null);
  427.             }
  428.         }
  429.         return $this;
  430.     }
  431.     /**
  432.      * @return Collection<int, ExamAgenda>
  433.      */
  434.     public function getExamAgendas(): Collection
  435.     {
  436.         return $this->examAgendas;
  437.     }
  438.     public function addExamAgenda(ExamAgenda $examAgenda): static
  439.     {
  440.         if (!$this->examAgendas->contains($examAgenda)) {
  441.             $this->examAgendas->add($examAgenda);
  442.             $examAgenda->setClasse($this);
  443.         }
  444.         return $this;
  445.     }
  446.     public function removeExamAgenda(ExamAgenda $examAgenda): static
  447.     {
  448.         if ($this->examAgendas->removeElement($examAgenda)) {
  449.             // set the owning side to null (unless already changed)
  450.             if ($examAgenda->getClasse() === $this) {
  451.                 $examAgenda->setClasse(null);
  452.             }
  453.         }
  454.         return $this;
  455.     }
  456.     /**
  457.      * @return Collection<int, SubSequence>
  458.      */
  459.     public function getSubSequences(): Collection
  460.     {
  461.         return $this->subSequences;
  462.     }
  463.     public function addSubSequence(SubSequence $subSequence): static
  464.     {
  465.         if (!$this->subSequences->contains($subSequence)) {
  466.             $this->subSequences->add($subSequence);
  467.             $subSequence->setClasse($this);
  468.         }
  469.         return $this;
  470.     }
  471.     public function removeSubSequence(SubSequence $subSequence): static
  472.     {
  473.         if ($this->subSequences->removeElement($subSequence)) {
  474.             // set the owning side to null (unless already changed)
  475.             if ($subSequence->getClasse() === $this) {
  476.                 $subSequence->setClasse(null);
  477.             }
  478.         }
  479.         return $this;
  480.     }
  481.     /**
  482.      * @return Collection<int, Quarter>
  483.      */
  484.     public function getQuarters(): Collection
  485.     {
  486.         return $this->quarters;
  487.     }
  488.     public function addQuarter(Quarter $quarter): static
  489.     {
  490.         if (!$this->quarters->contains($quarter)) {
  491.             $this->quarters->add($quarter);
  492.             $quarter->setClasse($this);
  493.         }
  494.         return $this;
  495.     }
  496.     public function removeQuarter(Quarter $quarter): static
  497.     {
  498.         if ($this->quarters->removeElement($quarter)) {
  499.             // set the owning side to null (unless already changed)
  500.             if ($quarter->getClasse() === $this) {
  501.                 $quarter->setClasse(null);
  502.             }
  503.         }
  504.         return $this;
  505.     }
  506.     /**
  507.      * @return Collection<int, SubNote>
  508.      */
  509.     public function getSubNotes(): Collection
  510.     {
  511.         return $this->subNotes;
  512.     }
  513.     public function addSubNote(SubNote $subNote): static
  514.     {
  515.         if (!$this->subNotes->contains($subNote)) {
  516.             $this->subNotes->add($subNote);
  517.             $subNote->setClasse($this);
  518.         }
  519.         return $this;
  520.     }
  521.     public function removeSubNote(SubNote $subNote): static
  522.     {
  523.         if ($this->subNotes->removeElement($subNote)) {
  524.             // set the owning side to null (unless already changed)
  525.             if ($subNote->getClasse() === $this) {
  526.                 $subNote->setClasse(null);
  527.             }
  528.         }
  529.         return $this;
  530.     }
  531.     /**
  532.      * @return Collection<int, Punish>
  533.      */
  534.     public function getPunishes(): Collection
  535.     {
  536.         return $this->punishes;
  537.     }
  538.     public function addPunish(Punish $punish): static
  539.     {
  540.         if (!$this->punishes->contains($punish)) {
  541.             $this->punishes->add($punish);
  542.             $punish->setClass($this);
  543.         }
  544.         return $this;
  545.     }
  546.     /**
  547.      * @return Collection<int, DisciplineWarning>
  548.      */
  549.     public function getDisciplineWarnings(): Collection
  550.     {
  551.         return $this->disciplineWarnings;
  552.     }
  553.     public function addDisciplineWarning(DisciplineWarning $disciplineWarning): static
  554.     {
  555.         if (!$this->disciplineWarnings->contains($disciplineWarning)) {
  556.             $this->disciplineWarnings->add($disciplineWarning);
  557.             $disciplineWarning->setClasse($this);
  558.         }
  559.         return $this;
  560.     }
  561.     public function removePunish(Punish $punish): static
  562.     {
  563.         if ($this->punishes->removeElement($punish)) {
  564.             // set the owning side to null (unless already changed)
  565.             if ($punish->getClass() === $this) {
  566.                 $punish->setClass(null);
  567.             }
  568.             return $this;
  569.         }
  570.     }
  571.     public function removeDisciplineWarning(DisciplineWarning $disciplineWarning): static
  572.     {
  573.         if ($this->disciplineWarnings->removeElement($disciplineWarning)) {
  574.             // set the owning side to null (unless already changed)
  575.             if ($disciplineWarning->getClasse() === $this) {
  576.                 $disciplineWarning->setClasse(null);
  577.             }
  578.         }
  579.         return $this;
  580.     }
  581.     /**
  582.      * @return Collection<int, DisciplineBlame>
  583.      */
  584.     public function getDisciplineBlames(): Collection
  585.     {
  586.         return $this->disciplineBlames;
  587.     }
  588.     public function addDisciplineBlame(DisciplineBlame $disciplineBlame): static
  589.     {
  590.         if (!$this->disciplineBlames->contains($disciplineBlame)) {
  591.             $this->disciplineBlames->add($disciplineBlame);
  592.             $disciplineBlame->setClasse($this);
  593.         }
  594.         return $this;
  595.     }
  596.     public function removeDisciplineBlame(DisciplineBlame $disciplineBlame): static
  597.     {
  598.         if ($this->disciplineBlames->removeElement($disciplineBlame)) {
  599.             // set the owning side to null (unless already changed)
  600.             if ($disciplineBlame->getClasse() === $this) {
  601.                 $disciplineBlame->setClasse(null);
  602.             }
  603.         }
  604.         return $this;
  605.     }
  606.     /**
  607.      * @return Collection<int, DisciplineExclusion>
  608.      */
  609.     public function getDisciplineExclusions(): Collection
  610.     {
  611.         return $this->disciplineExclusions;
  612.     }
  613.     public function addDisciplineExclusion(DisciplineExclusion $disciplineExclusion): static
  614.     {
  615.         if (!$this->disciplineExclusions->contains($disciplineExclusion)) {
  616.             $this->disciplineExclusions->add($disciplineExclusion);
  617.             $disciplineExclusion->setClasse($this);
  618.         }
  619.         return $this;
  620.     }
  621.     public function removeDisciplineExclusion(DisciplineExclusion $disciplineExclusion): static
  622.     {
  623.         if ($this->disciplineExclusions->removeElement($disciplineExclusion)) {
  624.             // set the owning side to null (unless already changed)
  625.             if ($disciplineExclusion->getClasse() === $this) {
  626.                 $disciplineExclusion->setClasse(null);
  627.             }
  628.         }
  629.         return $this;
  630.     }
  631.     /**
  632.      * @return Collection<int, ParentNote>
  633.      */
  634.     public function getParentNotes(): Collection
  635.     {
  636.         return $this->parentNotes;
  637.     }
  638.     public function addParentNote(ParentNote $parentNote): static
  639.     {
  640.         if (!$this->parentNotes->contains($parentNote)) {
  641.             $this->parentNotes->add($parentNote);
  642.             $parentNote->setClasse($this);
  643.         }
  644.         return $this;
  645.     }
  646.     public function removeParentNote(ParentNote $parentNote): static
  647.     {
  648.         if ($this->parentNotes->removeElement($parentNote)) {
  649.             // set the owning side to null (unless already changed)
  650.             if ($parentNote->getClasse() === $this) {
  651.                 $parentNote->setClasse(null);
  652.             }
  653.         }
  654.         return $this;
  655.     }
  656.     /**
  657.      * @return Collection<int, Absence>
  658.      */
  659.     public function getAbsences(): Collection
  660.     {
  661.         return $this->absences;
  662.     }
  663.     public function addAbsence(Absence $absence): static
  664.     {
  665.         if (!$this->absences->contains($absence)) {
  666.             $this->absences->add($absence);
  667.             $absence->setClasse($this);
  668.         }
  669.         return $this;
  670.     }
  671.     public function removeAbsence(Absence $absence): static
  672.     {
  673.         if ($this->absences->removeElement($absence)) {
  674.             // set the owning side to null (unless already changed)
  675.             if ($absence->getClasse() === $this) {
  676.                 $absence->setClasse(null);
  677.             }
  678.         }
  679.         return $this;
  680.     }
  681.     /**
  682.      * @return Collection<int, DisciplineRetained>
  683.      */
  684.     public function getDisciplineRetaineds(): Collection
  685.     {
  686.         return $this->disciplineRetaineds;
  687.     }
  688.     public function addDisciplineRetained(DisciplineRetained $disciplineRetained): static
  689.     {
  690.         if (!$this->disciplineRetaineds->contains($disciplineRetained)) {
  691.             $this->disciplineRetaineds->add($disciplineRetained);
  692.             $disciplineRetained->setClasse($this);
  693.         }
  694.         return $this;
  695.     }
  696.     public function removeDisciplineRetained(DisciplineRetained $disciplineRetained): static
  697.     {
  698.         if ($this->disciplineRetaineds->removeElement($disciplineRetained)) {
  699.             // set the owning side to null (unless already changed)
  700.             if ($disciplineRetained->getClasse() === $this) {
  701.                 $disciplineRetained->setClasse(null);
  702.             }
  703.         }
  704.         return $this;
  705.     }
  706.     public function getProf(): ?User
  707.     {
  708.         return $this->prof;
  709.     }
  710.     public function setProf(?User $prof): static
  711.     {
  712.         $this->prof $prof;
  713.         return $this;
  714.     }
  715.     /**
  716.      * @return Collection<int, PrimaryParentNote>
  717.      */
  718.     public function getPrimaryParentNotes(): Collection
  719.     {
  720.         return $this->primaryParentNotes;
  721.     }
  722.     public function addPrimaryParentNote(PrimaryParentNote $primaryParentNote): static
  723.     {
  724.         if (!$this->primaryParentNotes->contains($primaryParentNote)) {
  725.             $this->primaryParentNotes->add($primaryParentNote);
  726.             $primaryParentNote->setClasse($this);
  727.         }
  728.         return $this;
  729.     }
  730.     public function removePrimaryParentNote(PrimaryParentNote $primaryParentNote): static
  731.     {
  732.         if ($this->primaryParentNotes->removeElement($primaryParentNote)) {
  733.             // set the owning side to null (unless already changed)
  734.             if ($primaryParentNote->getClasse() === $this) {
  735.                 $primaryParentNote->setClasse(null);
  736.             }
  737.         }
  738.         return $this;
  739.     }
  740.     /**
  741.      * @return Collection<int, PrimaryNote>
  742.      */
  743.     public function getPrimaryNotes(): Collection
  744.     {
  745.         return $this->primaryNotes;
  746.     }
  747.     public function addPrimaryNote(PrimaryNote $primaryNote): static
  748.     {
  749.         if (!$this->primaryNotes->contains($primaryNote)) {
  750.             $this->primaryNotes->add($primaryNote);
  751.             $primaryNote->setClasse($this);
  752.         }
  753.         return $this;
  754.     }
  755.     public function removePrimaryNote(PrimaryNote $primaryNote): static
  756.     {
  757.         if ($this->primaryNotes->removeElement($primaryNote)) {
  758.             // set the owning side to null (unless already changed)
  759.             if ($primaryNote->getClasse() === $this) {
  760.                 $primaryNote->setClasse(null);
  761.             }
  762.         }
  763.         return $this;
  764.     }
  765.     /**
  766.      * @return Collection<int, DisciplinePunish>
  767.      */
  768.     public function getDisciplinePunishes(): Collection
  769.     {
  770.         return $this->disciplinePunishes;
  771.     }
  772.     public function addDisciplinePunish(DisciplinePunish $disciplinePunish): static
  773.     {
  774.         if (!$this->disciplinePunishes->contains($disciplinePunish)) {
  775.             $this->disciplinePunishes->add($disciplinePunish);
  776.             $disciplinePunish->setClasse($this);
  777.         }
  778.         return $this;
  779.     }
  780.     public function removeDisciplinePunish(DisciplinePunish $disciplinePunish): static
  781.     {
  782.         if ($this->disciplinePunishes->removeElement($disciplinePunish)) {
  783.             // set the owning side to null (unless already changed)
  784.             if ($disciplinePunish->getClasse() === $this) {
  785.                 $disciplinePunish->setClasse(null);
  786.             }
  787.         }
  788.         return $this;
  789.     }
  790.     /**
  791.      * @return Collection<int, Late>
  792.      */
  793.     public function getLates(): Collection
  794.     {
  795.         return $this->lates;
  796.     }
  797.     public function addLate(Late $late): static
  798.     {
  799.         if (!$this->lates->contains($late)) {
  800.             $this->lates->add($late);
  801.             $late->setClasse($this);
  802.         }
  803.         return $this;
  804.     }
  805.     public function removeLate(Late $late): static
  806.     {
  807.         if ($this->lates->removeElement($late)) {
  808.             // set the owning side to null (unless already changed)
  809.             if ($late->getClasse() === $this) {
  810.                 $late->setClasse(null);
  811.             }
  812.         }
  813.         return $this;
  814.     }
  815.     /**
  816.      * @return Collection<int, Blame>
  817.      */
  818.     public function getBlames(): Collection
  819.     {
  820.         return $this->blames;
  821.     }
  822.     public function addBlame(Blame $blame): static
  823.     {
  824.         if (!$this->blames->contains($blame)) {
  825.             $this->blames->add($blame);
  826.             $blame->setClasse($this);
  827.         }
  828.         return $this;
  829.     }
  830.     public function removeBlame(Blame $blame): static
  831.     {
  832.         if ($this->blames->removeElement($blame)) {
  833.             // set the owning side to null (unless already changed)
  834.             if ($blame->getClasse() === $this) {
  835.                 $blame->setClasse(null);
  836.             }
  837.         }
  838.         return $this;
  839.     }
  840.     /**
  841.      * @return Collection<int, Warning>
  842.      */
  843.     public function getWarnings(): Collection
  844.     {
  845.         return $this->warnings;
  846.     }
  847.     public function addWarning(Warning $warning): static
  848.     {
  849.         if (!$this->warnings->contains($warning)) {
  850.             $this->warnings->add($warning);
  851.             $warning->setClasse($this);
  852.         }
  853.         return $this;
  854.     }
  855.     public function removeWarning(Warning $warning): static
  856.     {
  857.         if ($this->warnings->removeElement($warning)) {
  858.             // set the owning side to null (unless already changed)
  859.             if ($warning->getClasse() === $this) {
  860.                 $warning->setClasse(null);
  861.             }
  862.         }
  863.         return $this;
  864.     }
  865.     /**
  866.      * @return Collection<int, Retained>
  867.      */
  868.     public function getRetaineds(): Collection
  869.     {
  870.         return $this->retaineds;
  871.     }
  872.     public function addRetained(Retained $retained): static
  873.     {
  874.         if (!$this->retaineds->contains($retained)) {
  875.             $this->retaineds->add($retained);
  876.             $retained->setClasse($this);
  877.         }
  878.         return $this;
  879.     }
  880.     public function removeRetained(Retained $retained): static
  881.     {
  882.         if ($this->retaineds->removeElement($retained)) {
  883.             // set the owning side to null (unless already changed)
  884.             if ($retained->getClasse() === $this) {
  885.                 $retained->setClasse(null);
  886.             }
  887.         }
  888.         return $this;
  889.     }
  890.     public function getSlug(): ?string
  891.     {
  892.         return $this->slug;
  893.     }
  894.     public function setSlug(?string $slug): static
  895.     {
  896.         $this->slug $slug;
  897.         return $this;
  898.     }
  899.     /**
  900.      * @return Collection<int, DisciplineConcile>
  901.      */
  902.     public function getDisciplineConciles(): Collection
  903.     {
  904.         return $this->disciplineConciles;
  905.     }
  906.     public function addDisciplineConcile(DisciplineConcile $disciplineConcile): static
  907.     {
  908.         if (!$this->disciplineConciles->contains($disciplineConcile)) {
  909.             $this->disciplineConciles->add($disciplineConcile);
  910.             $disciplineConcile->setClasse($this);
  911.         }
  912.         return $this;
  913.     }
  914.     public function removeDisciplineConcile(DisciplineConcile $disciplineConcile): static
  915.     {
  916.         if ($this->disciplineConciles->removeElement($disciplineConcile)) {
  917.             // set the owning side to null (unless already changed)
  918.             if ($disciplineConcile->getClasse() === $this) {
  919.                 $disciplineConcile->setClasse(null);
  920.             }
  921.         }
  922.         return $this;
  923.     }
  924.     public function getPrincipalProf(): ?UserYear
  925.     {
  926.         return $this->principalProf;
  927.     }
  928.     public function setPrincipalProf(?UserYear $principalProf): static
  929.     {
  930.         $this->principalProf $principalProf;
  931.         return $this;
  932.     }
  933.     /**
  934.      * @return Collection<int, Competence>
  935.      */
  936.     public function getCompetences(): Collection
  937.     {
  938.         return $this->competences;
  939.     }
  940.     public function addCompetence(Competence $competence): static
  941.     {
  942.         if (!$this->competences->contains($competence)) {
  943.             $this->competences->add($competence);
  944.             $competence->setClasse($this);
  945.         }
  946.         return $this;
  947.     }
  948.     public function removeCompetence(Competence $competence): static
  949.     {
  950.         if ($this->competences->removeElement($competence)) {
  951.             // set the owning side to null (unless already changed)
  952.             if ($competence->getClasse() === $this) {
  953.                 $competence->setClasse(null);
  954.             }
  955.         }
  956.         return $this;
  957.     }
  958.     /**
  959.      * @return Collection<int, WeekSubjectGoal>
  960.      */
  961.     public function getWeekSubjectGoals(): Collection
  962.     {
  963.         return $this->weekSubjectGoals;
  964.     }
  965.     public function addWeekSubjectGoal(WeekSubjectGoal $weekSubjectGoal): static
  966.     {
  967.         if (!$this->weekSubjectGoals->contains($weekSubjectGoal)) {
  968.             $this->weekSubjectGoals->add($weekSubjectGoal);
  969.             $weekSubjectGoal->setClasse($this);
  970.         }
  971.         return $this;
  972.     }
  973.     public function removeWeekSubjectGoal(WeekSubjectGoal $weekSubjectGoal): static
  974.     {
  975.         if ($this->weekSubjectGoals->removeElement($weekSubjectGoal)) {
  976.             // set the owning side to null (unless already changed)
  977.             if ($weekSubjectGoal->getClasse() === $this) {
  978.                 $weekSubjectGoal->setClasse(null);
  979.             }
  980.         }
  981.         return $this;
  982.     }
  983.     /**
  984.      * @return Collection<int, AgendaElement>
  985.      */
  986.     public function getAgendaElements(): Collection
  987.     {
  988.         return $this->agendaElements;
  989.     }
  990.     public function addAgendaElement(AgendaElement $agendaElement): static
  991.     {
  992.         if (!$this->agendaElements->contains($agendaElement)) {
  993.             $this->agendaElements->add($agendaElement);
  994.             $agendaElement->setClasse($this);
  995.         }
  996.         return $this;
  997.     }
  998.     public function removeAgendaElement(AgendaElement $agendaElement): static
  999.     {
  1000.         if ($this->agendaElements->removeElement($agendaElement)) {
  1001.             // set the owning side to null (unless already changed)
  1002.             if ($agendaElement->getClasse() === $this) {
  1003.                 $agendaElement->setClasse(null);
  1004.             }
  1005.         }
  1006.         return $this;
  1007.     }
  1008.     public function getClassLevel(): ?ClassLevel
  1009.     {
  1010.         return $this->classLevel;
  1011.     }
  1012.     public function setClassLevel(?ClassLevel $classLevel): static
  1013.     {
  1014.         $this->classLevel $classLevel;
  1015.         return $this;
  1016.     }
  1017.     // ── ClassOptions (ManyToMany) ──────────────────────────────────────
  1018.     /**
  1019.      * @return Collection<int, ClassOption>
  1020.      */
  1021.     public function getClassOptions(): Collection
  1022.     {
  1023.         return $this->classOptions;
  1024.     }
  1025.     public function addClassOption(ClassOption $classOption): static
  1026.     {
  1027.         if (!$this->classOptions->contains($classOption)) {
  1028.             $this->classOptions->add($classOption);
  1029.             $classOption->addTheClass($this);
  1030.         }
  1031.         return $this;
  1032.     }
  1033.     public function removeClassOption(ClassOption $classOption): static
  1034.     {
  1035.         if ($this->classOptions->removeElement($classOption)) {
  1036.             $classOption->removeTheClass($this);
  1037.         }
  1038.         return $this;
  1039.     }
  1040.     /**
  1041.      * Compatibilité : retourne la première option si elle existe.
  1042.      * Utile pour les vues qui n'affichent qu'une option.
  1043.      */
  1044.     public function getClassOption(): ?ClassOption
  1045.     {
  1046.         return $this->classOptions->first() ?: null;
  1047.     }
  1048.     // ── NextClasses (promotion) ─────────────────────────────────────────
  1049.     /**
  1050.      * @return Collection<int, TheClass>
  1051.      */
  1052.     public function getNextClasses(): Collection
  1053.     {
  1054.         return $this->nextClasses;
  1055.     }
  1056.     public function addNextClass(TheClass $nextClass): static
  1057.     {
  1058.         if (!$this->nextClasses->contains($nextClass)) {
  1059.             $this->nextClasses->add($nextClass);
  1060.         }
  1061.         return $this;
  1062.     }
  1063.     public function removeNextClass(TheClass $nextClass): static
  1064.     {
  1065.         $this->nextClasses->removeElement($nextClass);
  1066.         return $this;
  1067.     }
  1068.     /**
  1069.      * Retourne true si cette classe a exactement 1 classe suivante
  1070.      * (promotion automatique possible).
  1071.      */
  1072.     public function hasSingleNextClass(): bool
  1073.     {
  1074.         return $this->nextClasses->count() === 1;
  1075.     }
  1076. }