src/Entity/SettingLevel.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Repository\SettingLevelRepository;
  5. use Doctrine\Common\Collections\Collection;
  6. use App\Repository\SchoolReportCardRepository;
  7. use App\Service\SalaryManage;
  8. use DateTimeImmutable;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. /**
  11.  * @ORM\Entity(repositoryClass=SettingLevelRepository::class)
  12.  * Niveau CP1,6EME,2ND, TLE, ...
  13.  */
  14. class SettingLevel
  15. {
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=Establishment::class, inversedBy="settingLevels")
  24.      * @ORM\JoinColumn(nullable=false)
  25.      */
  26.     private $establishment;
  27.     /**
  28.      * @ORM\Column(type="string", length=128)
  29.      */
  30.     private $label;
  31.     /**
  32.      * @ORM\Column(type="datetime_immutable")
  33.      */
  34.     private $created_at;
  35.     /**
  36.      * @ORM\Column(type="datetime_immutable")
  37.      */
  38.     private $updated_at;
  39.     /**
  40.      * @ORM\Column(type="integer")
  41.      */
  42.     private $created_by;
  43.     /**
  44.      * @ORM\Column(type="integer")
  45.      */
  46.     private $updated_by;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity=SettingCycle::class, inversedBy="settingLevels")
  49.      */
  50.     private $cycle;
  51.     /**
  52.      * @ORM\OneToMany(targetEntity=SettingClassroom::class, mappedBy="level")
  53.      * @ORM\OrderBy({"label" = "ASC"})
  54.      */
  55.     private $settingClassrooms;
  56.     /**
  57.      * @ORM\OneToMany(targetEntity=SchoolMatter::class, mappedBy="level")
  58.      * @ORM\OrderBy({"order_num" = "ASC"})
  59.      */
  60.     private $schoolMatters;
  61.     /**
  62.      * @ORM\OneToMany(targetEntity=SchoolSubMatter::class, mappedBy="level")
  63.      */
  64.     private $schoolSubMatters;
  65.     /**
  66.      * @ORM\OneToMany(targetEntity=SchoolAssessmentByLevel::class, mappedBy="level")
  67.      */
  68.     private $schoolAssessmentByLevels;
  69.     /**
  70.      * @ORM\OneToMany(targetEntity=SchoolAssessmentByLevelByMatter::class, mappedBy="level")
  71.      */
  72.     private $schoolAssessmentByLevelByMatters;
  73.     /**
  74.      * @ORM\OneToMany(targetEntity=ReportCard::class, mappedBy="level")
  75.      */
  76.     private $reportCards;
  77.     /**
  78.      * @ORM\ManyToMany(targetEntity=SettingFee::class, mappedBy="levels")
  79.      */
  80.     private $settingFees;
  81.     /**
  82.      * @ORM\OneToMany(targetEntity=RegistrationStudent::class, mappedBy="entryLevel")
  83.      */
  84.     private $registrationStudents;
  85.     /**
  86.      * @ORM\Column(type="boolean")
  87.      */
  88.     private $is_student_entry_test_do;
  89.     /**
  90.      * @ORM\Column(type="boolean")
  91.      */
  92.     private $is_student_toxicological_test_do;
  93.     /**
  94.      * @ORM\Column(type="boolean")
  95.      */
  96.     private $is_student_psychological_test_do;
  97.     /**
  98.      * @ORM\Column(type="boolean")
  99.      */
  100.     private $is_student_cbe_affected;
  101.     /**
  102.      * @ORM\OneToMany(targetEntity=RegistrationStudentPreRegistration::class, mappedBy="entryLevel")
  103.      */
  104.     private $registrationStudentPreRegistrations;
  105.     /**
  106.      * @ORM\ManyToMany(targetEntity=RegistrationStudentPreRegistration::class, mappedBy="classJumps")
  107.      */
  108.     private $classJumpRegistrationStudentPreRegistrations;
  109.     /**
  110.      * @ORM\OneToMany(targetEntity=EntreTestReportCard::class, mappedBy="level")
  111.      */
  112.     private $entreTestReportCards;
  113.     /**
  114.      * @ORM\OneToMany(targetEntity=PreRegistrationEntreTestReportCard::class, mappedBy="level")
  115.      */
  116.     private $preRegistrationEntreTestReportCards;
  117.     /**
  118.      * @ORM\ManyToMany(targetEntity=CommunicationMessage::class, mappedBy="levels")
  119.      */
  120.     private $communicationMessages;
  121.     /**
  122.      * @ORM\ManyToOne(targetEntity=SettingLevel::class, inversedBy="childrens")
  123.      */
  124.     private $parent;
  125.     /**
  126.      * @ORM\OneToMany(targetEntity=SettingLevel::class, mappedBy="parent")
  127.      */
  128.     private $childrens;
  129.     /**
  130.      * @ORM\Column(type="integer", nullable=true)
  131.      */
  132.     private $num_order;
  133.     /**
  134.      * @ORM\OneToMany(targetEntity=SchoolAssessment::class, mappedBy="nextLevel")
  135.      */
  136.     private $schoolAssessments;
  137.     public function __construct()
  138.     {
  139.         $this->is_student_cbe_affected false;
  140.         $this->is_student_entry_test_do false;
  141.         $this->is_student_toxicological_test_do false;
  142.         $this->is_student_psychological_test_do false;
  143.         
  144.         $this->settingClassrooms = new ArrayCollection();
  145.         $this->settingFees = new ArrayCollection();
  146.         $this->schoolMatters = new ArrayCollection();
  147.         $this->schoolSubMatters = new ArrayCollection();
  148.         $this->schoolAssessmentByLevels = new ArrayCollection();
  149.         $this->schoolAssessmentByLevelByMatters = new ArrayCollection();
  150.         $this->reportCards = new ArrayCollection();
  151.         $this->registrationStudents = new ArrayCollection();
  152.         $this->registrationStudentPreRegistrations = new ArrayCollection();
  153.         $this->classJumpRegistrationStudentPreRegistrations = new ArrayCollection();
  154.         $this->entreTestReportCards = new ArrayCollection();
  155.         $this->preRegistrationEntreTestReportCards = new ArrayCollection();
  156.         $this->communicationMessages = new ArrayCollection();
  157.         $this->childrens = new ArrayCollection();
  158.         $this->schoolAssessments = new ArrayCollection();
  159.     }
  160.     public function __toString()
  161.     {
  162.         return $this->label;
  163.     }
  164.     public function getId(): ?int
  165.     {
  166.         return $this->id;
  167.     }
  168.     public function getEstablishment(): ?Establishment
  169.     {
  170.         return $this->establishment;
  171.     }
  172.     public function setEstablishment(?Establishment $establishment): self
  173.     {
  174.         $this->establishment $establishment;
  175.         return $this;
  176.     }
  177.     public function getCycle(): ?SettingCycle
  178.     {
  179.         return $this->cycle;
  180.     }
  181.     public function setCycle(?SettingCycle $cycle): self
  182.     {
  183.         $this->cycle $cycle;
  184.         return $this;
  185.     }
  186.     /**
  187.      * @return Collection|SettingClassroom[]
  188.      */
  189.     public function getSettingClassrooms(): Collection
  190.     {
  191.         return $this->settingClassrooms;
  192.     }
  193.     public function addSettingClassroom(SettingClassroom $settingClassroom): self
  194.     {
  195.         if (!$this->settingClassrooms->contains($settingClassroom)) {
  196.             $this->settingClassrooms[] = $settingClassroom;
  197.             $settingClassroom->setLevel($this);
  198.         }
  199.         return $this;
  200.     }
  201.     public function removeSettingClassroom(SettingClassroom $settingClassroom): self
  202.     {
  203.         if ($this->settingClassrooms->removeElement($settingClassroom)) {
  204.             // set the owning side to null (unless already changed)
  205.             if ($settingClassroom->getLevel() === $this) {
  206.                 $settingClassroom->setLevel(null);
  207.             }
  208.         }
  209.         return $this;
  210.     }
  211.     public function getLabel(): ?string
  212.     {
  213.         return $this->label;
  214.     }
  215.     public function setLabel(string $label): self
  216.     {
  217.         $this->label $label;
  218.         return $this;
  219.     }
  220.     public function getCreatedAt(): ?\DateTimeImmutable
  221.     {
  222.         return $this->created_at;
  223.     }
  224.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  225.     {
  226.         $this->created_at $created_at;
  227.         return $this;
  228.     }
  229.     public function getUpdatedAt(): ?\DateTimeImmutable
  230.     {
  231.         return $this->updated_at;
  232.     }
  233.     public function setUpdatedAt(\DateTimeImmutable $updated_at): self
  234.     {
  235.         $this->updated_at $updated_at;
  236.         return $this;
  237.     }
  238.     public function getCreatedBy(): ?int
  239.     {
  240.         return $this->created_by;
  241.     }
  242.     public function setCreatedBy(int $created_by): self
  243.     {
  244.         $this->created_by $created_by;
  245.         return $this;
  246.     }
  247.     public function getUpdatedBy(): ?int
  248.     {
  249.         return $this->updated_by;
  250.     }
  251.     public function setUpdatedBy(int $updated_by): self
  252.     {
  253.         $this->updated_by $updated_by;
  254.         return $this;
  255.     }
  256.     /**
  257.      * @return Collection|SchoolMatter[]
  258.      */
  259.     public function getSchoolMatters(): Collection
  260.     {
  261.         return $this->schoolMatters;
  262.     }
  263.     public function addSchoolMatter(SchoolMatter $schoolMatter): self
  264.     {
  265.         if (!$this->schoolMatters->contains($schoolMatter)) {
  266.             $this->schoolMatters[] = $schoolMatter;
  267.             $schoolMatter->setLevel($this);
  268.         }
  269.         return $this;
  270.     }
  271.     public function removeSchoolMatter(SchoolMatter $schoolMatter): self
  272.     {
  273.         if ($this->schoolMatters->removeElement($schoolMatter)) {
  274.             // set the owning side to null (unless already changed)
  275.             if ($schoolMatter->getLevel() === $this) {
  276.                 $schoolMatter->setLevel(null);
  277.             }
  278.         }
  279.         return $this;
  280.     }
  281.     /**
  282.      * @return Collection|SchoolSubMatter[]
  283.      */
  284.     public function getSchoolSubMatters(): Collection
  285.     {
  286.         return $this->schoolSubMatters;
  287.     }
  288.     public function addSchoolSubMatter(SchoolSubMatter $schoolSubMatter): self
  289.     {
  290.         if (!$this->schoolSubMatters->contains($schoolSubMatter)) {
  291.             $this->schoolSubMatters[] = $schoolSubMatter;
  292.             $schoolSubMatter->setLevel($this);
  293.         }
  294.         return $this;
  295.     }
  296.     public function removeSchoolSubMatter(SchoolSubMatter $schoolSubMatter): self
  297.     {
  298.         if ($this->schoolSubMatters->removeElement($schoolSubMatter)) {
  299.             // set the owning side to null (unless already changed)
  300.             if ($schoolSubMatter->getLevel() === $this) {
  301.                 $schoolSubMatter->setLevel(null);
  302.             }
  303.         }
  304.         return $this;
  305.     }
  306.     /**
  307.      * @return Collection|SchoolAssessmentByLevel[]
  308.      */
  309.     public function getSchoolAssessmentByLevels(): Collection
  310.     {
  311.         return $this->schoolAssessmentByLevels;
  312.     }
  313.     public function addSchoolAssessmentByLevel(SchoolAssessmentByLevel $schoolAssessmentByLevel): self
  314.     {
  315.         if (!$this->schoolAssessmentByLevels->contains($schoolAssessmentByLevel)) {
  316.             $this->schoolAssessmentByLevels[] = $schoolAssessmentByLevel;
  317.             $schoolAssessmentByLevel->setLevel($this);
  318.         }
  319.         return $this;
  320.     }
  321.     public function removeSchoolAssessmentByLevel(SchoolAssessmentByLevel $schoolAssessmentByLevel): self
  322.     {
  323.         if ($this->schoolAssessmentByLevels->removeElement($schoolAssessmentByLevel)) {
  324.             // set the owning side to null (unless already changed)
  325.             if ($schoolAssessmentByLevel->getLevel() === $this) {
  326.                 $schoolAssessmentByLevel->setLevel(null);
  327.             }
  328.         }
  329.         return $this;
  330.     }
  331.     /**
  332.      * @return Collection|SchoolAssessmentByLevelByMatter[]
  333.      */
  334.     public function getSchoolAssessmentByLevelByMatters(): Collection
  335.     {
  336.         return $this->schoolAssessmentByLevelByMatters;
  337.     }
  338.     public function addSchoolAssessmentByLevelByMatter(SchoolAssessmentByLevelByMatter $schoolAssessmentByLevelByMatter): self
  339.     {
  340.         if (!$this->schoolAssessmentByLevelByMatters->contains($schoolAssessmentByLevelByMatter)) {
  341.             $this->schoolAssessmentByLevelByMatters[] = $schoolAssessmentByLevelByMatter;
  342.             $schoolAssessmentByLevelByMatter->setLevel($this);
  343.         }
  344.         return $this;
  345.     }
  346.     public function removeSchoolAssessmentByLevelByMatter(SchoolAssessmentByLevelByMatter $schoolAssessmentByLevelByMatter): self
  347.     {
  348.         if ($this->schoolAssessmentByLevelByMatters->removeElement($schoolAssessmentByLevelByMatter)) {
  349.             // set the owning side to null (unless already changed)
  350.             if ($schoolAssessmentByLevelByMatter->getLevel() === $this) {
  351.                 $schoolAssessmentByLevelByMatter->setLevel(null);
  352.             }
  353.         }
  354.         return $this;
  355.     }
  356.     /**
  357.      * @return Collection|ReportCard[]
  358.      */
  359.     public function getReportCards(): Collection
  360.     {
  361.         return $this->reportCards;
  362.     }
  363.     public function addReportCard(ReportCard $reportCard): self
  364.     {
  365.         if (!$this->reportCards->contains($reportCard)) {
  366.             $this->reportCards[] = $reportCard;
  367.             $reportCard->setLevel($this);
  368.         }
  369.         return $this;
  370.     }
  371.     public function removeReportCard(ReportCard $reportCard): self
  372.     {
  373.         if ($this->reportCards->removeElement($reportCard)) {
  374.             // set the owning side to null (unless already changed)
  375.             if ($reportCard->getLevel() === $this) {
  376.                 $reportCard->setLevel(null);
  377.             }
  378.         }
  379.         return $this;
  380.     }
  381.     /**
  382.      * @return Collection|SettingFee[]
  383.      */
  384.     public function getSettingFees(): Collection
  385.     {
  386.         return $this->settingFees;
  387.     }
  388.     public function addSettingFee(SettingFee $settingFee): self
  389.     {
  390.         if (!$this->settingFees->contains($settingFee)) {
  391.             $this->settingFees[] = $settingFee;
  392.             $settingFee->addLevel($this);
  393.         }
  394.         return $this;
  395.     }
  396.     public function removeSettingFee(SettingFee $settingFee): self
  397.     {
  398.         if ($this->settingFees->removeElement($settingFee)) {
  399.             $settingFee->removeLevel($this);
  400.         }
  401.         return $this;
  402.     }
  403.     /**
  404.      * @return Collection|RegistrationStudent[]
  405.      */
  406.     public function getRegistrationStudents(): Collection
  407.     {
  408.         return $this->registrationStudents;
  409.     }
  410.     public function addRegistrationStudent(RegistrationStudent $registrationStudent): self
  411.     {
  412.         if (!$this->registrationStudents->contains($registrationStudent)) {
  413.             $this->registrationStudents[] = $registrationStudent;
  414.             $registrationStudent->setEntryLevel($this);
  415.         }
  416.         return $this;
  417.     }
  418.     public function removeRegistrationStudent(RegistrationStudent $registrationStudent): self
  419.     {
  420.         if ($this->registrationStudents->removeElement($registrationStudent)) {
  421.             // set the owning side to null (unless already changed)
  422.             if ($registrationStudent->getEntryLevel() === $this) {
  423.                 $registrationStudent->setEntryLevel(null);
  424.             }
  425.         }
  426.         return $this;
  427.     }
  428.     public function getIsStudentEntryTestDo(): ?bool
  429.     {
  430.         return $this->is_student_entry_test_do;
  431.     }
  432.     public function setIsStudentEntryTestDo(bool $is_student_entry_test_do): self
  433.     {
  434.         $this->is_student_entry_test_do $is_student_entry_test_do;
  435.         return $this;
  436.     }
  437.     public function getIsStudentToxicologicalTestDo(): ?bool
  438.     {
  439.         return $this->is_student_toxicological_test_do;
  440.     }
  441.     public function setIsStudentToxicologicalTestDo(bool $is_student_toxicological_test_do): self
  442.     {
  443.         $this->is_student_toxicological_test_do $is_student_toxicological_test_do;
  444.         return $this;
  445.     }
  446.     public function getIsStudentPsychologicalTestDo(): ?bool
  447.     {
  448.         return $this->is_student_psychological_test_do;
  449.     }
  450.     public function setIsStudentPsychologicalTestDo(bool $is_student_psychological_test_do): self
  451.     {
  452.         $this->is_student_psychological_test_do $is_student_psychological_test_do;
  453.         return $this;
  454.     }
  455.     /**
  456.      * @return Collection|RegistrationStudentPreRegistration[]
  457.      */
  458.     public function getRegistrationStudentPreRegistrations(): Collection
  459.     {
  460.         return $this->registrationStudentPreRegistrations;
  461.     }
  462.     public function addRegistrationStudentPreRegistration(RegistrationStudentPreRegistration $registrationStudentPreRegistration): self
  463.     {
  464.         if (!$this->registrationStudentPreRegistrations->contains($registrationStudentPreRegistration)) {
  465.             $this->registrationStudentPreRegistrations[] = $registrationStudentPreRegistration;
  466.             $registrationStudentPreRegistration->setEntryLevel($this);
  467.         }
  468.         return $this;
  469.     }
  470.     public function removeRegistrationStudentPreRegistration(RegistrationStudentPreRegistration $registrationStudentPreRegistration): self
  471.     {
  472.         if ($this->registrationStudentPreRegistrations->removeElement($registrationStudentPreRegistration)) {
  473.             // set the owning side to null (unless already changed)
  474.             if ($registrationStudentPreRegistration->getEntryLevel() === $this) {
  475.                 $registrationStudentPreRegistration->setEntryLevel(null);
  476.             }
  477.         }
  478.         return $this;
  479.     }
  480.     /**
  481.      * @return Collection|RegistrationStudentPreRegistration[]
  482.      */
  483.     public function getClassJumpRegistrationStudentPreRegistrations(): Collection
  484.     {
  485.         return $this->classJumpRegistrationStudentPreRegistrations;
  486.     }
  487.     public function addClassJumpRegistrationStudentPreRegistration(RegistrationStudentPreRegistration $classJumpRegistrationStudentPreRegistration): self
  488.     {
  489.         if (!$this->classJumpRegistrationStudentPreRegistrations->contains($classJumpRegistrationStudentPreRegistration)) {
  490.             $this->classJumpRegistrationStudentPreRegistrations[] = $classJumpRegistrationStudentPreRegistration;
  491.             $classJumpRegistrationStudentPreRegistration->addClassJump($this);
  492.         }
  493.         return $this;
  494.     }
  495.     public function removeClassJumpRegistrationStudentPreRegistration(RegistrationStudentPreRegistration $classJumpRegistrationStudentPreRegistration): self
  496.     {
  497.         if ($this->classJumpRegistrationStudentPreRegistrations->removeElement($classJumpRegistrationStudentPreRegistration)) {
  498.             $classJumpRegistrationStudentPreRegistration->removeClassJump($this);
  499.         }
  500.         return $this;
  501.     }
  502.     /**
  503.      * @return Collection|EntreTestReportCard[]
  504.      */
  505.     public function getEntreTestReportCards(): Collection
  506.     {
  507.         return $this->entreTestReportCards;
  508.     }
  509.     public function addEntreTestReportCard(EntreTestReportCard $entreTestReportCard): self
  510.     {
  511.         if (!$this->entreTestReportCards->contains($entreTestReportCard)) {
  512.             $this->entreTestReportCards[] = $entreTestReportCard;
  513.             $entreTestReportCard->setLevel($this);
  514.         }
  515.         return $this;
  516.     }
  517.     public function removeEntreTestReportCard(EntreTestReportCard $entreTestReportCard): self
  518.     {
  519.         if ($this->entreTestReportCards->removeElement($entreTestReportCard)) {
  520.             // set the owning side to null (unless already changed)
  521.             if ($entreTestReportCard->getLevel() === $this) {
  522.                 $entreTestReportCard->setLevel(null);
  523.             }
  524.         }
  525.         return $this;
  526.     }
  527.     /**
  528.      * @return Collection|PreRegistrationEntreTestReportCard[]
  529.      */
  530.     public function getPreRegistrationEntreTestReportCards(): Collection
  531.     {
  532.         return $this->preRegistrationEntreTestReportCards;
  533.     }
  534.     public function addPreRegistrationEntreTestReportCard(PreRegistrationEntreTestReportCard $preRegistrationEntreTestReportCard): self
  535.     {
  536.         if (!$this->preRegistrationEntreTestReportCards->contains($preRegistrationEntreTestReportCard)) {
  537.             $this->preRegistrationEntreTestReportCards[] = $preRegistrationEntreTestReportCard;
  538.             $preRegistrationEntreTestReportCard->setLevel($this);
  539.         }
  540.         return $this;
  541.     }
  542.     public function removePreRegistrationEntreTestReportCard(PreRegistrationEntreTestReportCard $preRegistrationEntreTestReportCard): self
  543.     {
  544.         if ($this->preRegistrationEntreTestReportCards->removeElement($preRegistrationEntreTestReportCard)) {
  545.             // set the owning side to null (unless already changed)
  546.             if ($preRegistrationEntreTestReportCard->getLevel() === $this) {
  547.                 $preRegistrationEntreTestReportCard->setLevel(null);
  548.             }
  549.         }
  550.         return $this;
  551.     }
  552.     public function getCanteenregistered(SchoolYear $schoolYear){
  553.         $registereds = new ArrayCollection();
  554.         foreach ($this->getSettingClassrooms() as $key => $cettingClassroom) {
  555.             foreach ($cettingClassroom->getRegistrationStudentRegistrations() as $key => $registrationStudentRegistration) {
  556.                 if ($registrationStudentRegistration->hasCanteenFee() && $registrationStudentRegistration->getSchoolYear() == $schoolYear) {
  557.                     $registereds->add($registrationStudentRegistration);
  558.                 }  
  559.             }
  560.         }
  561.         return $registereds;
  562.     }
  563.     /**
  564.      * @return Collection|CommunicationMessage[]
  565.      */
  566.     public function getCommunicationMessages(): Collection
  567.     {
  568.         return $this->communicationMessages;
  569.     }
  570.     public function addCommunicationMessage(CommunicationMessage $communicationMessage): self
  571.     {
  572.         if (!$this->communicationMessages->contains($communicationMessage)) {
  573.             $this->communicationMessages[] = $communicationMessage;
  574.             $communicationMessage->addLevel($this);
  575.         }
  576.         return $this;
  577.     }
  578.     public function removeCommunicationMessage(CommunicationMessage $communicationMessage): self
  579.     {
  580.         if ($this->communicationMessages->removeElement($communicationMessage)) {
  581.             $communicationMessage->removeLevel($this);
  582.         }
  583.         return $this;
  584.     }
  585.     public function getParent(): ?self
  586.     {
  587.         return $this->parent;
  588.     }
  589.     public function setParent(?self $parent): self
  590.     {
  591.         $this->parent $parent;
  592.         return $this;
  593.     }
  594.     /**
  595.      * @return Collection|self[]
  596.      */
  597.     public function getChildrens(): Collection
  598.     {
  599.         return $this->childrens;
  600.     }
  601.     public function addChildren(self $children): self
  602.     {
  603.         if (!$this->childrens->contains($children)) {
  604.             $this->childrens[] = $children;
  605.             $children->setParent($this);
  606.         }
  607.         return $this;
  608.     }
  609.     public function removeChildren(self $children): self
  610.     {
  611.         if ($this->childrens->removeElement($children)) {
  612.             // set the owning side to null (unless already changed)
  613.             if ($children->getParent() === $this) {
  614.                 $children->setParent(null);
  615.             }
  616.         }
  617.         return $this;
  618.     }
  619.     public function getRegistered(SchoolYear $schoolYear){
  620.         $registereds = new ArrayCollection();
  621.         if (count($this->getChildrens()) > 0) {
  622.             foreach ($this->getChildrens() as $key => $children) {
  623.                 foreach ($children->getSettingClassrooms() as $key => $settingClassroom) {
  624.                     foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $registrationStudentRegistration) {
  625.                         if ($registrationStudentRegistration->getSchoolYear() == $schoolYear) {
  626.                             $registereds->add($registrationStudentRegistration);
  627.                         } 
  628.                     }
  629.                 }
  630.             }
  631.             return $registereds;
  632.         }
  633.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom){
  634.             foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $registrationStudentRegistration) {
  635.                 if ($registrationStudentRegistration->getSchoolYear() == $schoolYear) {
  636.                     $registereds->add($registrationStudentRegistration);
  637.                 }  
  638.             }
  639.         }
  640.         return $registereds;
  641.     }
  642.     public function getMRegistered(SchoolYear $schoolYear){
  643.         $registereds = new ArrayCollection();
  644.         if (count($this->getChildrens()) > 0) {
  645.             foreach ($this->getChildrens() as $key => $children) {
  646.                 foreach ($children->getSettingClassrooms() as $key => $settingClassroom) {
  647.                     foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  648.                         if ($studentRegistration->getSchoolYear() == $schoolYear) {
  649.                             if ($studentRegistration->getStudent()->getGender() == 'MASCULIN') {
  650.                                 $registereds->add($studentRegistration);
  651.                             }
  652.                         }
  653.                     }
  654.                 }
  655.             }
  656.             return $registereds;
  657.         }
  658.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  659.             foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  660.                 if ($studentRegistration->getSchoolYear() == $schoolYear) {
  661.                     if ($studentRegistration->getStudent()->getGender() == 'MASCULIN') {
  662.                         $registereds->add($studentRegistration);
  663.                     }
  664.                 }
  665.             }
  666.         }
  667.         return $registereds;
  668.     }
  669.     public function getFRegistered(SchoolYear $schoolYear){
  670.         $registereds = new ArrayCollection();
  671.         if (count($this->getChildrens()) > 0) {
  672.             foreach ($this->getChildrens() as $key => $children) {
  673.                 foreach ($children->getSettingClassrooms() as $key => $settingClassroom) {
  674.                     foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  675.                         if ($studentRegistration->getSchoolYear() == $schoolYear) {
  676.                             if ($studentRegistration->getStudent()->getGender() == 'FEMININ') {
  677.                                 $registereds->add($studentRegistration);
  678.                             }
  679.                         }
  680.                     }
  681.                 }
  682.             }
  683.             return $registereds;
  684.         }
  685.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  686.             foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  687.                 if ($studentRegistration->getSchoolYear() == $schoolYear) {
  688.                     if ($studentRegistration->getStudent()->getGender() == 'FEMININ') {
  689.                         $registereds->add($studentRegistration);
  690.                     }
  691.                 }
  692.             }
  693.         }
  694.         return $registereds;
  695.     }
  696.     public function getRedoublingRegistereds(SchoolYear $schoolYear){
  697.         $registereds = new ArrayCollection();
  698.         if (count($this->getChildrens()) > 0) {
  699.             foreach ($this->getChildrens() as $key => $children) {
  700.                 foreach ($children->getSettingClassrooms() as $key => $settingClassroom) {
  701.                     foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  702.                         if ($studentRegistration->getSchoolYear() == $schoolYear && $studentRegistration->getIsRedoubling()) {
  703.                             $registereds->add($studentRegistration);
  704.                         }
  705.                     }
  706.                 }
  707.             }
  708.             return $registereds;
  709.         }
  710.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  711.             foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  712.                 if ($studentRegistration->getSchoolYear() == $schoolYear && $studentRegistration->getIsRedoubling()) {
  713.                     $registereds->add($studentRegistration);
  714.                 }
  715.             }
  716.         }
  717.         return $registereds;
  718.     }
  719.     public function getMRedoublingRegistereds(SchoolYear $schoolYear){
  720.         $registereds = new ArrayCollection();
  721.         if (count($this->getChildrens()) > 0) {
  722.             foreach ($this->getChildrens() as $key => $children) {
  723.                 foreach ($children->getSettingClassrooms() as $key => $settingClassroom) {
  724.                     foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  725.                         if ($studentRegistration->getSchoolYear() == $schoolYear && $studentRegistration->getIsRedoubling()) {
  726.                             if ($studentRegistration->getStudent()->getGender() == 'MASCULIN') {
  727.                                 $registereds->add($studentRegistration);
  728.                             }
  729.                         }
  730.                     }
  731.                 }
  732.             }
  733.             return $registereds;
  734.         }
  735.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  736.             foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  737.                 if ($studentRegistration->getSchoolYear() == $schoolYear && $studentRegistration->getIsRedoubling()) {
  738.                     if ($studentRegistration->getStudent()->getGender() == 'MASCULIN') {
  739.                         $registereds->add($studentRegistration);
  740.                     }
  741.                 }
  742.             }
  743.         }
  744.         return $registereds;
  745.     }
  746.     public function getFRedoublingRegistereds(SchoolYear $schoolYear){
  747.         $registereds = new ArrayCollection();
  748.         if (count($this->getChildrens()) > 0) {
  749.             foreach ($this->getChildrens() as $key => $children) {
  750.                 foreach ($children->getSettingClassrooms() as $key => $settingClassroom) {
  751.                     foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  752.                         if ($studentRegistration->getSchoolYear() == $schoolYear && $studentRegistration->getIsRedoubling()) {
  753.                             if ($studentRegistration->getStudent()->getGender() == 'FEMININ') {
  754.                                 $registereds->add($studentRegistration);
  755.                             }
  756.                         }
  757.                     }
  758.                 }
  759.             }
  760.             return $registereds;
  761.         }
  762.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  763.             foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  764.                 if ($studentRegistration->getSchoolYear() == $schoolYear && $studentRegistration->getIsRedoubling()) {
  765.                     if ($studentRegistration->getStudent()->getGender() == 'FEMININ') {
  766.                         $registereds->add($studentRegistration);
  767.                     }
  768.                 }
  769.             }
  770.         }
  771.         return $registereds;
  772.     }
  773.     public function getNumOrder(): ?int
  774.     {
  775.         return $this->num_order;
  776.     }
  777.     public function setNumOrder(?int $num_order): self
  778.     {
  779.         $this->num_order $num_order;
  780.         return $this;
  781.     }
  782.     //for report
  783.     public function studentsPeriodeReportCard(SchoolYearPeriode $schoolYearPeriode$gender null)
  784.     {
  785.         $schoolReportCards = new ArrayCollection();
  786.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  787.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  788.                 if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  789.                     if (!$schoolReportCard->isUnclassified()) {
  790.                         if (null == $gender) {
  791.                             $schoolReportCards->add($schoolReportCard);
  792.                         }else {
  793.                             if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  794.                                 $schoolReportCards->add($schoolReportCard);
  795.                             }
  796.                         }
  797.                     }
  798.                 }
  799.             }
  800.         }
  801.         return $schoolReportCards;
  802.     }
  803.     public function allStudentsPeriodeReportCard(SchoolYearPeriode $schoolYearPeriode$gender null)
  804.     {
  805.         $schoolReportCards = new ArrayCollection();
  806.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  807.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  808.                 if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  809.                     if (null == $gender) {
  810.                         $schoolReportCards->add($schoolReportCard);
  811.                     }else {
  812.                         if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  813.                             $schoolReportCards->add($schoolReportCard);
  814.                         }
  815.                     }
  816.                 }
  817.             }
  818.         }
  819.         return $schoolReportCards;
  820.     }
  821.     public function studentsPeriodeVSupOrEqual(float $vSupSchoolYearPeriode $schoolYearPeriode$gender null$resultType 'Trimestriel')
  822.     {
  823.         $schoolReportCards = new ArrayCollection();
  824.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  825.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  826.                 if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  827.                     if ($resultType == 'Trimestriel') {
  828.                         if (($schoolReportCard->getReportCardAverage() / ($schoolReportCard->getNoteOn() / 20)) >= $vSup) {
  829.                             if (null == $gender) {
  830.                                 $schoolReportCards->add($schoolReportCard);
  831.                             }else {
  832.                                 if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  833.                                     $schoolReportCards->add($schoolReportCard);
  834.                                 }
  835.                             }
  836.                         }
  837.                     }else {
  838.                         if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) >= $vSup) {
  839.                             if (null == $gender) {
  840.                                 if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) <= 20 && ($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) > 0) {
  841.                                     $schoolReportCards->add($schoolReportCard);
  842.                                 }
  843.                             }else {
  844.                                 if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  845.                                     if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) <= 20 && ($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) > 0) {
  846.                                         $schoolReportCards->add($schoolReportCard);
  847.                                     }
  848.                                 }
  849.                             }
  850.                         }
  851.                     }
  852.                 }
  853.             }
  854.         }
  855.         return $schoolReportCards;
  856.     }
  857.     public function studentsPeriodeVSupVInf(float $vSupfloat $vInfSchoolYearPeriode $schoolYearPeriode$gender null$resultType 'Trimestriel')
  858.     {
  859.         $schoolReportCards = new ArrayCollection();
  860.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  861.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  862.                 if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  863.                     if ($resultType == 'Trimestriel') {
  864.                         if (($schoolReportCard->getReportCardAverage() / ($schoolReportCard->getNoteOn() / 20)) >= $vInf && ($schoolReportCard->getReportCardAverage() / ($schoolReportCard->getNoteOn() / 20)) < $vSup) {
  865.                             if (null == $gender) {
  866.                                 $schoolReportCards->add($schoolReportCard);
  867.                             }else {
  868.                                 if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  869.                                     $schoolReportCards->add($schoolReportCard);
  870.                                 }
  871.                             }
  872.                         }
  873.                     }else {
  874.                         if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) >= $vInf && ($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) < $vSup) {
  875.                             if (null == $gender) {
  876.                                 if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) <= 20) {
  877.                                     $schoolReportCards->add($schoolReportCard);
  878.                                 }
  879.                             }else {
  880.                                 if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  881.                                     if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) <= 20) {
  882.                                         $schoolReportCards->add($schoolReportCard);
  883.                                     }
  884.                                 }
  885.                             }
  886.                         }
  887.                     }
  888.                 }
  889.             }
  890.         }
  891.         return $schoolReportCards;
  892.     }
  893.     public function studentsPeriodeVInf(float $vInfSchoolYearPeriode $schoolYearPeriode$gender null$resultType 'Trimestriel')
  894.     {
  895.         $schoolReportCards = new ArrayCollection();
  896.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  897.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  898.                 if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  899.                     if ($resultType == 'Trimestriel') {
  900.                         if (($schoolReportCard->getReportCardAverage() / ($schoolReportCard->getNoteOn() / 20)) < $vInf) {
  901.                             if (!$schoolReportCard->getIsUnclassified()) {
  902.                                 if (null == $gender) {
  903.                                     $schoolReportCards->add($schoolReportCard);
  904.                                 }else {
  905.                                     if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  906.                                         $schoolReportCards->add($schoolReportCard);
  907.                                     }
  908.                                 }
  909.                             }
  910.                         }
  911.                     }else {
  912.                         if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) < $vInf) {
  913.                             if (!$schoolReportCard->getIsUnclassified()) {
  914.                                 if (null == $gender) {
  915.                                     if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) <= 20) {
  916.                                         $schoolReportCards->add($schoolReportCard);
  917.                                     }
  918.                                 }else {
  919.                                     if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  920.                                         if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) <= 20) {
  921.                                             $schoolReportCards->add($schoolReportCard);
  922.                                         }
  923.                                     }
  924.                                 }
  925.                             }
  926.                         }
  927.                     }
  928.                 }
  929.             }
  930.         }
  931.         return $schoolReportCards;
  932.     }
  933.     public function periodeAverage(SchoolYearPeriode $schoolYearPeriode$gender null$resultType 'Trimestriel')
  934.     {
  935.         $count 0;
  936.         $average 0;
  937.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  938.             if(count($settingClassroom->studentsPeriodeReportCard($schoolYearPeriode)) > 0){
  939.                 $average += $settingClassroom->periodeAverage($schoolYearPeriode$resultType);
  940.                 $count += 1;
  941.             }
  942.         }
  943.         $pAv 0;
  944.         if($count 0){
  945.             $pAv $average $count;
  946.         }
  947.         return $pAv;
  948.     }
  949.     /** for redoubling */
  950.     public function studentsPeriodeReportCardRed(SchoolYearPeriode $schoolYearPeriode$gender null$red false)
  951.     {
  952.         $schoolReportCards = new ArrayCollection();
  953.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  954.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  955.                 if ($schoolReportCard->getStudentRegistration()->getIsRedoubling() == $red) {
  956.                     if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  957.                         if (!$schoolReportCard->isUnclassified()) {
  958.                             if (null == $gender) {
  959.                                 $schoolReportCards->add($schoolReportCard);
  960.                             }else {
  961.                                 if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  962.                                     $schoolReportCards->add($schoolReportCard);
  963.                                 }
  964.                             }
  965.                         }
  966.                     }
  967.                 }
  968.             }
  969.         }
  970.         return $schoolReportCards;
  971.     }
  972.     public function allStudentsPeriodeReportCardRed(SchoolYearPeriode $schoolYearPeriode$gender null$red false)
  973.     {
  974.         $schoolReportCards = new ArrayCollection();
  975.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  976.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  977.                 if ($schoolReportCard->getStudentRegistration()->getIsRedoubling() == $red) {
  978.                     if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  979.                         if (null == $gender) {
  980.                             $schoolReportCards->add($schoolReportCard);
  981.                         }else {
  982.                             if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  983.                                 $schoolReportCards->add($schoolReportCard);
  984.                             }
  985.                         }
  986.                     }
  987.                 }
  988.             }
  989.         }
  990.         return $schoolReportCards;
  991.     }
  992.     public function studentsPeriodeVSupOrEqualRed(float $vSupSchoolYearPeriode $schoolYearPeriode$gender null$red false$resultType 'Trimestriel')
  993.     {
  994.         $schoolReportCards = new ArrayCollection();
  995.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  996.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  997.                 if ($schoolReportCard->getStudentRegistration()->getIsRedoubling() == $red) {
  998.                     if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  999.                         if ($resultType == 'Trimestriel') {
  1000.                             if (($schoolReportCard->getReportCardAverage() / ($schoolReportCard->getNoteOn() / 20)) >= $vSup) {
  1001.                                 if (null == $gender) {
  1002.                                     $schoolReportCards->add($schoolReportCard);
  1003.                                 }else {
  1004.                                     if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  1005.                                         $schoolReportCards->add($schoolReportCard);
  1006.                                     }
  1007.                                 }
  1008.                             }
  1009.                         }else {
  1010.                             if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) >= $vSup) {
  1011.                                 if (null == $gender) {
  1012.                                     if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) <= 20) {
  1013.                                         $schoolReportCards->add($schoolReportCard);
  1014.                                     }
  1015.                                 }else {
  1016.                                     if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  1017.                                         if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) <= 20) {
  1018.                                             $schoolReportCards->add($schoolReportCard);
  1019.                                         }
  1020.                                     }
  1021.                                 }
  1022.                             }
  1023.                         }
  1024.                     }
  1025.                 }
  1026.             }
  1027.         }
  1028.         return $schoolReportCards;
  1029.     }
  1030.     public function studentsPeriodeVSupVInfRed(float $vSupfloat $vInfSchoolYearPeriode $schoolYearPeriode$gender null$red false$resultType 'Trimestriel')
  1031.     {
  1032.         $schoolReportCards = new ArrayCollection();
  1033.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1034.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  1035.                 if ($schoolReportCard->getStudentRegistration()->getIsRedoubling() == $red) {
  1036.                     if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  1037.                         if ($resultType == 'Trimestriel') {
  1038.                             if (($schoolReportCard->getReportCardAverage() / ($schoolReportCard->getNoteOn() / 20)) >= $vInf && ($schoolReportCard->getReportCardAverage() / ($schoolReportCard->getNoteOn() / 20)) < $vSup) {
  1039.                                 if (null == $gender) {
  1040.                                     $schoolReportCards->add($schoolReportCard);
  1041.                                 }else {
  1042.                                     if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  1043.                                         $schoolReportCards->add($schoolReportCard);
  1044.                                     }
  1045.                                 }
  1046.                             }
  1047.                         }else {
  1048.                             if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) >= $vInf && ($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) < $vSup) {
  1049.                                 if (null == $gender) {
  1050.                                     if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) <= 20) {
  1051.                                         $schoolReportCards->add($schoolReportCard);
  1052.                                     }
  1053.                                 }else {
  1054.                                     if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  1055.                                         if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) <= 20) {
  1056.                                             $schoolReportCards->add($schoolReportCard);
  1057.                                         }
  1058.                                     }
  1059.                                 }
  1060.                             }
  1061.                         }
  1062.                     }
  1063.                 }
  1064.             }
  1065.         }
  1066.         return $schoolReportCards;
  1067.     }
  1068.     public function studentsPeriodeVInfRed(float $vInfSchoolYearPeriode $schoolYearPeriode$gender null$red false$resultType 'Trimestriel')
  1069.     {
  1070.         $schoolReportCards = new ArrayCollection();
  1071.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1072.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  1073.                 if ($schoolReportCard->getStudentRegistration()->getIsRedoubling() == $red) {
  1074.                     if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  1075.                         if ($resultType == 'Trimestriel') {
  1076.                             if (($schoolReportCard->getReportCardAverage() / ($schoolReportCard->getNoteOn() / 20)) < $vInf) {
  1077.                                 if (!$schoolReportCard->getIsUnclassified()) {
  1078.                                     if (null == $gender) {
  1079.                                         $schoolReportCards->add($schoolReportCard);
  1080.                                     }else {
  1081.                                         if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  1082.                                             $schoolReportCards->add($schoolReportCard);
  1083.                                         }
  1084.                                     }
  1085.                                 }
  1086.                             }
  1087.                         }else {
  1088.                             if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) < $vInf) {
  1089.                                 if (!$schoolReportCard->getIsUnclassified()) {
  1090.                                     if (null == $gender) {
  1091.                                         if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) <= 20) {
  1092.                                             $schoolReportCards->add($schoolReportCard);
  1093.                                         }
  1094.                                     }else {
  1095.                                         if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == $gender) {
  1096.                                             if (($schoolReportCard->getAnnualAverage() / ($schoolReportCard->getNoteOn() / 20)) <= 20) {
  1097.                                                 $schoolReportCards->add($schoolReportCard);
  1098.                                             }
  1099.                                         }
  1100.                                     }
  1101.                                 }
  1102.                             }
  1103.                         }
  1104.                     }
  1105.                 }
  1106.             }
  1107.         }
  1108.         return $schoolReportCards;
  1109.     }
  1110.     public function periodeAverageRed(SchoolYearPeriode $schoolYearPeriode$gender null$red false$resultType 'Trimestriel')
  1111.     {
  1112.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1113.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  1114.                 if ($schoolReportCard->getStudentRegistration()->getIsRedoubling() == $red) {
  1115.                     if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  1116.                         if ($resultType == 'Trimestriel') {
  1117.                             return $schoolReportCard->getClassAverage();
  1118.                         }else {
  1119.                             return $schoolReportCard->getClassAnnualAverage();
  1120.                         }
  1121.                     }
  1122.                 }
  1123.             }
  1124.         }
  1125.         return 0;
  1126.     }
  1127.     //
  1128.     
  1129.     public function major(SchoolYearPeriode $schoolYearPeriodeSchoolReportCardRepository $schoolReportCardRepositoryint $nb 1)
  1130.     {
  1131.         $schoolReportCards $schoolReportCardRepository->createQueryBuilder('entity')
  1132.         ->andWhere('entity.schoolYearPeriode = :schoolYearPeriode')
  1133.         ->setParameter('schoolYearPeriode'$schoolYearPeriode)
  1134.         ->innerJoin('entity.classroom''classroom')
  1135.         ->addSelect('classroom')
  1136.         ->andWhere('classroom.level = :level')
  1137.         ->setParameter('level'$this)
  1138.         ->orderBy('entity.report_card_average''DESC')
  1139.         ->setMaxResults($nb)
  1140.         ->getQuery()
  1141.         ->getResult();
  1142.         
  1143.         return $schoolReportCards;
  1144.     }
  1145.     public function annualMajor(SchoolYearPeriode $schoolYearPeriodeSchoolReportCardRepository $schoolReportCardRepositoryint $nb 1)
  1146.     {
  1147.         $schoolReportCards $schoolReportCardRepository->createQueryBuilder('entity')
  1148.         ->andWhere('entity.schoolYearPeriode = :schoolYearPeriode')
  1149.         ->setParameter('schoolYearPeriode'$schoolYearPeriode)
  1150.         ->innerJoin('entity.classroom''classroom')
  1151.         ->addSelect('classroom')
  1152.         ->andWhere('classroom.level = :level')
  1153.         ->setParameter('level'$this)
  1154.         ->orderBy('entity.annual_average''DESC')
  1155.         ->setMaxResults($nb)
  1156.         ->getQuery()
  1157.         ->getResult();
  1158.         
  1159.         return $schoolReportCards;
  1160.     }
  1161.     // repartition par age
  1162.     public function repartitionByLevelBirthday(SchoolYear $schoolYear$age$gender null$red null){
  1163.         $registereds = new ArrayCollection();
  1164.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1165.             foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  1166.                 if ($studentRegistration->getSchoolYear() == $schoolYear) {
  1167.                     if (null == $red) {
  1168.                         if (null == $gender) {
  1169.                             if ($studentRegistration->getStudent()->getBirthday() != null) {
  1170.                                 if(SalaryManage::MyYearDiff($studentRegistration->getStudent()->getBirthday(), new DateTimeImmutable()) == $age){
  1171.                                     $registereds->add($studentRegistration);
  1172.                                 }
  1173.                             }
  1174.                         }else {
  1175.                             if ($studentRegistration->getStudent()->getGender() == $gender) {
  1176.                                 if ($studentRegistration->getStudent()->getBirthday() != null) {
  1177.                                     if(SalaryManage::MyYearDiff($studentRegistration->getStudent()->getBirthday(), new DateTimeImmutable()) == $age){
  1178.                                         $registereds->add($studentRegistration);
  1179.                                     }
  1180.                                 }
  1181.                             }
  1182.                         }
  1183.                     }else{
  1184.                         if ($studentRegistration->getIsRedoubling() == $red) {
  1185.                             if (null == $gender) {
  1186.                                 if ($studentRegistration->getStudent()->getBirthday() != null) {
  1187.                                     if(SalaryManage::MyYearDiff($studentRegistration->getStudent()->getBirthday(), new DateTimeImmutable()) == $age){
  1188.                                         $registereds->add($studentRegistration);
  1189.                                     }
  1190.                                 }
  1191.                             }else {
  1192.                                 if ($studentRegistration->getStudent()->getGender() == $gender) {
  1193.                                     if ($studentRegistration->getStudent()->getBirthday() != null) {
  1194.                                         if(SalaryManage::MyYearDiff($studentRegistration->getStudent()->getBirthday(), new DateTimeImmutable()) == $age){
  1195.                                             $registereds->add($studentRegistration);
  1196.                                         }
  1197.                                     }
  1198.                                 }
  1199.                             }
  1200.                         }
  1201.                     }
  1202.                 }
  1203.             }
  1204.         }
  1205.         return $registereds;
  1206.     }
  1207.     public function repartitionMinusByLevelBirthday(SchoolYear $schoolYear$age$gender null$red null){
  1208.         $registereds = new ArrayCollection();
  1209.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1210.             foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  1211.                 if ($studentRegistration->getSchoolYear() == $schoolYear) {
  1212.                     if (null == $red) {
  1213.                         if (null == $gender) {
  1214.                             if ($studentRegistration->getStudent()->getBirthday() != null) {
  1215.                                 if(SalaryManage::MyYearDiff($studentRegistration->getStudent()->getBirthday(), new DateTimeImmutable()) < $age){
  1216.                                     $registereds->add($studentRegistration);
  1217.                                 }
  1218.                             }
  1219.                         }else {
  1220.                             if ($studentRegistration->getStudent()->getGender() == $gender) {
  1221.                                 if ($studentRegistration->getStudent()->getBirthday() != null) {
  1222.                                     if(SalaryManage::MyYearDiff($studentRegistration->getStudent()->getBirthday(), new DateTimeImmutable()) < $age){
  1223.                                         $registereds->add($studentRegistration);
  1224.                                     }
  1225.                                 }
  1226.                             }
  1227.                         }
  1228.                     }else{
  1229.                         if ($studentRegistration->getIsRedoubling() == $red) {
  1230.                             if (null == $gender) {
  1231.                                 if ($studentRegistration->getStudent()->getBirthday() != null) {
  1232.                                     if(SalaryManage::MyYearDiff($studentRegistration->getStudent()->getBirthday(), new DateTimeImmutable()) < $age){
  1233.                                         $registereds->add($studentRegistration);
  1234.                                     }
  1235.                                 }
  1236.                             }else {
  1237.                                 if ($studentRegistration->getStudent()->getGender() == $gender) {
  1238.                                     if ($studentRegistration->getStudent()->getBirthday() != null) {
  1239.                                         if(SalaryManage::MyYearDiff($studentRegistration->getStudent()->getBirthday(), new DateTimeImmutable()) < $age){
  1240.                                             $registereds->add($studentRegistration);
  1241.                                         }
  1242.                                     }
  1243.                                 }
  1244.                             }
  1245.                         }
  1246.                     }
  1247.                 }
  1248.             }
  1249.         }
  1250.         return $registereds;
  1251.     }
  1252.     public function repartitionPlusByLevelBirthday(SchoolYear $schoolYear$age$gender null$red null){
  1253.         $registereds = new ArrayCollection();
  1254.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1255.             foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  1256.                 if ($studentRegistration->getSchoolYear() == $schoolYear) {
  1257.                     if (null == $red) {
  1258.                         if (null == $gender) {
  1259.                             if ($studentRegistration->getStudent()->getBirthday() != null) {
  1260.                                 if(SalaryManage::MyYearDiff($studentRegistration->getStudent()->getBirthday(), new DateTimeImmutable()) > $age){
  1261.                                     $registereds->add($studentRegistration);
  1262.                                 }
  1263.                             }
  1264.                         }else {
  1265.                             if ($studentRegistration->getStudent()->getGender() == $gender) {
  1266.                                 if ($studentRegistration->getStudent()->getBirthday() != null) {
  1267.                                     if(SalaryManage::MyYearDiff($studentRegistration->getStudent()->getBirthday(), new DateTimeImmutable()) > $age){
  1268.                                         $registereds->add($studentRegistration);
  1269.                                     }
  1270.                                 }
  1271.                             }
  1272.                         }
  1273.                     }else{
  1274.                         if ($studentRegistration->getIsRedoubling() == $red) {
  1275.                             if (null == $gender) {
  1276.                                 if ($studentRegistration->getStudent()->getBirthday() != null) {
  1277.                                     if(SalaryManage::MyYearDiff($studentRegistration->getStudent()->getBirthday(), new DateTimeImmutable()) > $age){
  1278.                                         $registereds->add($studentRegistration);
  1279.                                     }
  1280.                                 }
  1281.                             }else {
  1282.                                 if ($studentRegistration->getStudent()->getGender() == $gender) {
  1283.                                     if ($studentRegistration->getStudent()->getBirthday() != null) {
  1284.                                         if(SalaryManage::MyYearDiff($studentRegistration->getStudent()->getBirthday(), new DateTimeImmutable()) > $age){
  1285.                                             $registereds->add($studentRegistration);
  1286.                                         }
  1287.                                     }
  1288.                                 }
  1289.                             }
  1290.                         }
  1291.                     }
  1292.                 }
  1293.             }
  1294.         }
  1295.         return $registereds;
  1296.     }
  1297.     public function getDiet(SchoolYear $schoolYear$gender null){
  1298.         $registereds = new ArrayCollection();
  1299.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1300.             foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  1301.                 if ($studentRegistration->getSchoolYear() == $schoolYear && $studentRegistration->getIsDiet()) {
  1302.                     if(null == $gender){
  1303.                         $registereds->add($studentRegistration);
  1304.                     }else{
  1305.                         if ($studentRegistration->getStudent()->getGender() == $gender) {
  1306.                             $registereds->add($studentRegistration);
  1307.                         }
  1308.                     }
  1309.                         
  1310.                 }
  1311.             }
  1312.         }
  1313.         return $registereds;
  1314.     }
  1315.     public function registeredByGender(SchoolYear $schoolYear$gender null$red null){
  1316.         $registereds = new ArrayCollection();
  1317.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1318.             foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  1319.                 if ($studentRegistration->getSchoolYear() == $schoolYear) {
  1320.                     if(null == $red){
  1321.                         if(null == $gender){
  1322.                             $registereds->add($studentRegistration);
  1323.                         }else{
  1324.                             if ($studentRegistration->getStudent()->getGender() == $gender) {
  1325.                                 $registereds->add($studentRegistration);
  1326.                             }
  1327.                         }
  1328.                     }else{
  1329.                         if($red == $studentRegistration->getIsRedoubling()){
  1330.                             if(null == $gender){
  1331.                                 $registereds->add($studentRegistration);
  1332.                             }else{
  1333.                                 if ($studentRegistration->getStudent()->getGender() == $gender) {
  1334.                                     $registereds->add($studentRegistration);
  1335.                                 }
  1336.                             }
  1337.                         }
  1338.                     }
  1339.                 }
  1340.             }
  1341.         }
  1342.         return $registereds;
  1343.     }
  1344.     public function registeredIvByGender(SchoolYear $schoolYear$gender null$red null){
  1345.         $registereds = new ArrayCollection();
  1346.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1347.             foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  1348.                 if ($studentRegistration->getSchoolYear() == $schoolYear) {
  1349.                     if(strtoupper(substr($studentRegistration->getStudent()->getNationality(), 02)) == 'IV'){
  1350.                         if(null == $red){
  1351.                             if(null == $gender){
  1352.                                 $registereds->add($studentRegistration);
  1353.                             }else{
  1354.                                 if ($studentRegistration->getStudent()->getGender() == $gender) {
  1355.                                     $registereds->add($studentRegistration);
  1356.                                 }
  1357.                             }
  1358.                         }else{
  1359.                             if($red == $studentRegistration->getIsRedoubling()){
  1360.                                 if(null == $gender){
  1361.                                     $registereds->add($studentRegistration);
  1362.                                 }else{
  1363.                                     if ($studentRegistration->getStudent()->getGender() == $gender) {
  1364.                                         $registereds->add($studentRegistration);
  1365.                                     }
  1366.                                 }
  1367.                             }
  1368.                         }
  1369.                     }
  1370.                 }
  1371.             }
  1372.         }
  1373.         return $registereds;
  1374.     }
  1375.     public function registeredEtByGender(SchoolYear $schoolYear$gender null$red null){
  1376.         $registereds = new ArrayCollection();
  1377.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1378.             foreach ($settingClassroom->getRegistrationStudentRegistrations() as $key => $studentRegistration) {
  1379.                 if ($studentRegistration->getSchoolYear() == $schoolYear) {
  1380.                     if(strtoupper(substr($studentRegistration->getStudent()->getNationality(), 02)) != 'IV'){
  1381.                         if(null == $red){
  1382.                             if(null == $gender){
  1383.                                 $registereds->add($studentRegistration);
  1384.                             }else{
  1385.                                 if ($studentRegistration->getStudent()->getGender() == $gender) {
  1386.                                     $registereds->add($studentRegistration);
  1387.                                 }
  1388.                             }
  1389.                         }else{
  1390.                             if($red == $studentRegistration->getIsRedoubling()){
  1391.                                 if(null == $gender){
  1392.                                     $registereds->add($studentRegistration);
  1393.                                 }else{
  1394.                                     if ($studentRegistration->getStudent()->getGender() == $gender) {
  1395.                                         $registereds->add($studentRegistration);
  1396.                                     }
  1397.                                 }
  1398.                             }
  1399.                         }
  1400.                     }
  1401.                 }
  1402.             }
  1403.         }
  1404.         return $registereds;
  1405.     }
  1406.     //
  1407.     public function periodeAverageReportCard(SchoolYearPeriode $schoolYearPeriodeEquivalentMatter $equivalentMatter)
  1408.     {
  1409.         $schoolAverageReportCards = new ArrayCollection();
  1410.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1411.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  1412.                 if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  1413.                     foreach ($schoolReportCard->getSchoolAverageReportCards() as $key => $schoolAverageReportCard) {
  1414.                         if ($schoolAverageReportCard->getSubMatter() == null) {
  1415.                             if ($schoolAverageReportCard->getMatter()->getEquivalentMatter() == $equivalentMatter) {
  1416.                                 if ($schoolAverageReportCard->getAverage() < 999) {
  1417.                                     $schoolAverageReportCards->add($schoolReportCard);
  1418.                                 }
  1419.                             }
  1420.                         }else {
  1421.                             if ($equivalentMatter->getParent() != null) {
  1422.                                 if ($schoolAverageReportCard->getSubMatter()->getEquivalentMatter() == $equivalentMatter) {
  1423.                                     if ($schoolAverageReportCard->getAverage() < 999) {
  1424.                                         $schoolAverageReportCards->add($schoolReportCard);
  1425.                                     }
  1426.                                 }
  1427.                             }
  1428.                         }
  1429.                     }
  1430.                 }
  1431.             }
  1432.         }
  1433.         return $schoolAverageReportCards;
  1434.     }
  1435.     public function periodeAverageReportCardMasculin(SchoolYearPeriode $schoolYearPeriodeEquivalentMatter $equivalentMatter)
  1436.     {
  1437.         $schoolAverageReportCards = new ArrayCollection();
  1438.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1439.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  1440.                 if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == 'MASCULIN') {
  1441.                     if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  1442.                         foreach ($schoolReportCard->getSchoolAverageReportCards() as $key => $schoolAverageReportCard) {
  1443.                             
  1444.                             if ($schoolAverageReportCard->getSubMatter() == null) {
  1445.                                 if ($schoolAverageReportCard->getMatter()->getEquivalentMatter() == $equivalentMatter) {
  1446.                                     if ($schoolAverageReportCard->getAverage() < 999) {
  1447.                                         $schoolAverageReportCards->add($schoolReportCard);
  1448.                                     }
  1449.                                 }
  1450.                             }else {
  1451.                                 if ($equivalentMatter->getParent() != null) {
  1452.                                     if ($schoolAverageReportCard->getSubMatter()->getEquivalentMatter() == $equivalentMatter) {
  1453.                                         if ($schoolAverageReportCard->getAverage() < 999) {
  1454.                                             $schoolAverageReportCards->add($schoolReportCard);
  1455.                                         }
  1456.                                     }
  1457.                                 }
  1458.                             }
  1459.                         }
  1460.                     }
  1461.                 }
  1462.             }
  1463.         }
  1464.         return $schoolAverageReportCards;
  1465.     }
  1466.     public function periodeAverageReportCardFeminin(SchoolYearPeriode $schoolYearPeriodeEquivalentMatter $equivalentMatter)
  1467.     {
  1468.         $schoolAverageReportCards = new ArrayCollection();
  1469.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1470.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  1471.                 if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == 'FEMININ') {
  1472.                     if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  1473.                         foreach ($schoolReportCard->getSchoolAverageReportCards() as $key => $schoolAverageReportCard) {
  1474.                             
  1475.                             if ($schoolAverageReportCard->getSubMatter() == null) {
  1476.                                 if ($schoolAverageReportCard->getMatter()->getEquivalentMatter() == $equivalentMatter) {
  1477.                                     if ($schoolAverageReportCard->getAverage() < 999) {
  1478.                                         $schoolAverageReportCards->add($schoolReportCard);
  1479.                                     }
  1480.                                 }
  1481.                             }else {
  1482.                                 if ($equivalentMatter->getParent() != null) {
  1483.                                     if ($schoolAverageReportCard->getSubMatter()->getEquivalentMatter() == $equivalentMatter) {
  1484.                                         if ($schoolAverageReportCard->getAverage() < 999) {
  1485.                                             $schoolAverageReportCards->add($schoolReportCard);
  1486.                                         }
  1487.                                     }
  1488.                                 }
  1489.                             }
  1490.                         }
  1491.                     }
  1492.                 }
  1493.             }
  1494.         }
  1495.         return $schoolAverageReportCards;
  1496.     }
  1497.     public function periodeAveragePeriodeVInf(float $vInfSchoolYearPeriode $schoolYearPeriodeEquivalentMatter $equivalentMatter)
  1498.     {
  1499.         $schoolAverageReportCards = new ArrayCollection();
  1500.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1501.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  1502.                 if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  1503.                     foreach ($schoolReportCard->getSchoolAverageReportCards() as $key => $schoolAverageReportCard) {
  1504.                         if ($schoolAverageReportCard->getSubMatter() == null) {
  1505.                             if ($schoolAverageReportCard->getMatter()->getEquivalentMatter() == $equivalentMatter) {
  1506.                                 if ($schoolAverageReportCard->getAverage() < 999 && $schoolAverageReportCard->getAverage() < $vInf) {
  1507.                                     $schoolAverageReportCards->add($schoolReportCard);
  1508.                                 }
  1509.                             }
  1510.                         }else {
  1511.                             if ($equivalentMatter->getParent() != null) {
  1512.                                 if ($schoolAverageReportCard->getSubMatter()->getEquivalentMatter() == $equivalentMatter) {
  1513.                                     if ($schoolAverageReportCard->getAverage() < 999 && $schoolAverageReportCard->getAverage() < $vInf) {
  1514.                                         $schoolAverageReportCards->add($schoolReportCard);
  1515.                                     }
  1516.                                 }
  1517.                             }
  1518.                         }
  1519.                     }
  1520.                 }
  1521.             }
  1522.         }
  1523.         return $schoolAverageReportCards;
  1524.     }
  1525.     public function periodeAveragePeriodeVInfMasculin(float $vInfSchoolYearPeriode $schoolYearPeriodeEquivalentMatter $equivalentMatter)
  1526.     {
  1527.         $schoolAverageReportCards = new ArrayCollection();
  1528.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1529.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  1530.                 if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == 'MASCULIN') {
  1531.                     if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  1532.                         foreach ($schoolReportCard->getSchoolAverageReportCards() as $key => $schoolAverageReportCard) {
  1533.                             if ($schoolAverageReportCard->getSubMatter() == null) {
  1534.                                 if ($schoolAverageReportCard->getMatter()->getEquivalentMatter() == $equivalentMatter) {
  1535.                                     if ($schoolAverageReportCard->getAverage() < 999 && $schoolAverageReportCard->getAverage() < $vInf) {
  1536.                                         $schoolAverageReportCards->add($schoolReportCard);
  1537.                                     }
  1538.                                 }
  1539.                             }else {
  1540.                                 if ($equivalentMatter->getParent() != null) {
  1541.                                     if ($schoolAverageReportCard->getSubMatter()->getEquivalentMatter() == $equivalentMatter) {
  1542.                                         if ($schoolAverageReportCard->getAverage() < 999 && $schoolAverageReportCard->getAverage() < $vInf) {
  1543.                                             $schoolAverageReportCards->add($schoolReportCard);
  1544.                                         }
  1545.                                     }
  1546.                                 }
  1547.                             }
  1548.                         }
  1549.                     }
  1550.                 }
  1551.             }
  1552.         }
  1553.         return $schoolAverageReportCards;
  1554.     }
  1555.     public function periodeAveragePeriodeVInfFeminin(float $vInfSchoolYearPeriode $schoolYearPeriodeEquivalentMatter $equivalentMatter)
  1556.     {
  1557.         $schoolAverageReportCards = new ArrayCollection();
  1558.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1559.             foreach ($settingClassroom->getSchoolReportCards() as $key => $schoolReportCard) {
  1560.                 if ($schoolReportCard->getStudentRegistration()->getStudent()->getGender() == 'FEMININ') {
  1561.                     if ($schoolReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  1562.                         foreach ($schoolReportCard->getSchoolAverageReportCards() as $key => $schoolAverageReportCard) {
  1563.                             if ($schoolAverageReportCard->getSubMatter() == null) {
  1564.                                 if ($schoolAverageReportCard->getMatter()->getEquivalentMatter() == $equivalentMatter) {
  1565.                                     if ($schoolAverageReportCard->getAverage() < 999 && $schoolAverageReportCard->getAverage() < $vInf) {
  1566.                                         $schoolAverageReportCards->add($schoolReportCard);
  1567.                                     }
  1568.                                 }
  1569.                             }else {
  1570.                                 if ($equivalentMatter->getParent() != null) {
  1571.                                     if ($schoolAverageReportCard->getSubMatter()->getEquivalentMatter() == $equivalentMatter) {
  1572.                                         if ($schoolAverageReportCard->getAverage() < 999 && $schoolAverageReportCard->getAverage() < $vInf) {
  1573.                                             $schoolAverageReportCards->add($schoolReportCard);
  1574.                                         }
  1575.                                     }
  1576.                                 }
  1577.                             }
  1578.                         }
  1579.                     }
  1580.                 }
  1581.             }
  1582.         }
  1583.         return $schoolAverageReportCards;
  1584.     }
  1585.     /**
  1586.      * @return Collection|SchoolAssessment[]
  1587.      */
  1588.     public function getSchoolAssessments(): Collection
  1589.     {
  1590.         return $this->schoolAssessments;
  1591.     }
  1592.     public function addSchoolAssessment(SchoolAssessment $schoolAssessment): self
  1593.     {
  1594.         if (!$this->schoolAssessments->contains($schoolAssessment)) {
  1595.             $this->schoolAssessments[] = $schoolAssessment;
  1596.             $schoolAssessment->setNextLevel($this);
  1597.         }
  1598.         return $this;
  1599.     }
  1600.     public function removeSchoolAssessment(SchoolAssessment $schoolAssessment): self
  1601.     {
  1602.         if ($this->schoolAssessments->removeElement($schoolAssessment)) {
  1603.             // set the owning side to null (unless already changed)
  1604.             if ($schoolAssessment->getNextLevel() === $this) {
  1605.                 $schoolAssessment->setNextLevel(null);
  1606.             }
  1607.         }
  1608.         return $this;
  1609.     }
  1610.     public function getClassrooms(SchoolYear $schoolYear)
  1611.     {
  1612.         $classrooms = new ArrayCollection();
  1613.         foreach ($this->getSettingClassrooms() as $key => $settingClassroom) {
  1614.             if ($settingClassroom->getSchoolYear() == $schoolYear) {
  1615.                 $classrooms->add($settingClassroom);
  1616.             }
  1617.         }
  1618.         return $classrooms;
  1619.     }
  1620.     public function getIsStudentCbeAffected(): ?bool
  1621.     {
  1622.         return $this->is_student_cbe_affected;
  1623.     }
  1624.     public function setIsStudentCbeAffected(bool $is_student_cbe_affected): self
  1625.     {
  1626.         $this->is_student_cbe_affected $is_student_cbe_affected;
  1627.         return $this;
  1628.     }
  1629. }