src/Entity/RegistrationStudentRegistration.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RegistrationStudentRegistrationRepository;
  4. use App\Repository\SchoolReportCardRepository;
  5. use DateTimeImmutable;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\HttpFoundation\File\File;
  10. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. /**
  13.  * @ORM\Entity(repositoryClass=RegistrationStudentRegistrationRepository::class)
  14.  * Inscrits
  15.  * @Vich\Uploadable
  16.  */
  17. class RegistrationStudentRegistration
  18. {
  19.     /**
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue
  22.      * @ORM\Column(type="integer")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity=Establishment::class, inversedBy="registrationStudentRegistrations")
  27.      * @ORM\JoinColumn(nullable=false)
  28.      */
  29.     private $establishment;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity=RegistrationStudent::class, inversedBy="registrationStudentRegistrations")
  32.      * @ORM\JoinColumn(nullable=false)
  33.      */
  34.     private $student;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity=SchoolYear::class, inversedBy="registrationStudentRegistrations")
  37.      * @ORM\JoinColumn(nullable=false)
  38.      */
  39.     private $schoolYear;
  40.     /**
  41.      * @ORM\ManyToOne(targetEntity=SettingClassroom::class, inversedBy="registrationStudentRegistrations")
  42.      * @ORM\JoinColumn(nullable=false)
  43.      */
  44.     private $classroom;
  45.     /**
  46.      * @ORM\Column(type="boolean")
  47.      */
  48.     private $is_redoubling;
  49.     /**
  50.      * @ORM\Column(type="boolean")
  51.      * est boursier
  52.      */
  53.     private $is_diet;
  54.     /**
  55.      * @ORM\Column(type="boolean")
  56.      * est interne
  57.      */
  58.     private $is_internal;
  59.     /**
  60.      * @ORM\Column(type="boolean")
  61.      * est affecte(e)
  62.     */
  63.     private $is_affected;
  64.     /**
  65.      * @ORM\Column(type="date_immutable")
  66.     */
  67.     private $registered_at;
  68.     /**
  69.      * @ORM\Column(type="datetime_immutable")
  70.     */
  71.     private $created_at;
  72.     /**
  73.      * @ORM\Column(type="datetime_immutable")
  74.      */
  75.     private $updated_at;
  76.     /**
  77.      * @ORM\Column(type="integer")
  78.      */
  79.     private $created_by;
  80.     /**
  81.      * @ORM\Column(type="integer")
  82.      */
  83.     private $updated_by;
  84.     /**
  85.      * @ORM\OneToMany(targetEntity=AccountingStudentRegistrationFee::class, mappedBy="studentRegistration")
  86.      */
  87.     private $accountingStudentRegistrationFees;
  88.     /**
  89.      * @ORM\OneToMany(targetEntity=SchoolReportCard::class, mappedBy="studentRegistration")
  90.      * @ORM\OrderBy({"id" = "ASC"})
  91.      */
  92.     private $schoolReportCards;
  93.     /**
  94.      * @ORM\OneToMany(targetEntity=SchoolAverageReportCard::class, mappedBy="studentRegistration")
  95.      */
  96.     private $schoolAverageReportCards;
  97.     /**
  98.      * @ORM\OneToMany(targetEntity=SchoolAssessmentByClass::class, mappedBy="studentRegistration")
  99.      */
  100.     private $schoolAssessmentByClasses;
  101.     /**
  102.      * @ORM\OneToMany(targetEntity=SchoolAssessmentByLevel::class, mappedBy="studentRegistration")
  103.      */
  104.     private $schoolAssessmentByLevels;
  105.     /**
  106.      * @ORM\OneToMany(targetEntity=SchoolAssessmentByClassByMatter::class, mappedBy="studentRegistration")
  107.      */
  108.     private $schoolAssessmentByClassByMatters;
  109.     /**
  110.      * @ORM\OneToMany(targetEntity=SchoolAssessmentByLevelByMatter::class, mappedBy="studentRegistration")
  111.      */
  112.     private $schoolAssessmentByLevelByMatters;
  113.     /**
  114.      * @ORM\OneToMany(targetEntity=AccountingStudentRegistrationPayment::class, mappedBy="studentRegistration")
  115.      */
  116.     private $accountingStudentRegistrationPayments;
  117.     /**
  118.      * @ORM\Column(type="float", nullable=true)
  119.     */
  120.     private $last_amount_paid;
  121.     /**
  122.      * @ORM\Column(type="integer", nullable=true)
  123.     */
  124.     private $last_payment_id;
  125.     /**
  126.      * @ORM\Column(type="datetime_immutable", nullable=true)
  127.     */
  128.     private $last_payment_at;
  129.     /**
  130.      * @ORM\Column(type="string", length=255, nullable=true)
  131.      */
  132.     private $image;
  133.     /**
  134.      * NOTE: This is not a mapped field of entity metadata, just a simple property.
  135.      * 
  136.      * @Vich\UploadableField(mapping="student", fileNameProperty="image")
  137.      * 
  138.      * @var File|null
  139.      * @Assert\File(
  140.      * maxSize = "25M",
  141.      * mimeTypes = {"image/png", "image/jpg", "image/jpeg"},
  142.      * mimeTypesMessage = "Veuillez télécharger une image valide (png, jpg, jpeg)",
  143.      * maxSizeMessage = "Le fichier est trop volumineux ({{size}} {{suffix}}). La taille maximale autorisée est {{limit}} {{suffix}}"
  144.      * )
  145.      */
  146.     private $imageFile;
  147.     /**
  148.      * @ORM\OneToMany(targetEntity=RegistrationClassChange::class, mappedBy="studentRegistration")
  149.      */
  150.     private $registrationClassChanges;
  151.     /**
  152.      * @ORM\OneToMany(targetEntity=RegistrationStudentDowngrade::class, mappedBy="registrationStudentRegistration")
  153.      */
  154.     private $registrationStudentDowngrades;
  155.     /**
  156.      * @ORM\OneToMany(targetEntity=RegistrationStudentAbandonment::class, mappedBy="registrationStudentRegistration")
  157.      */
  158.     private $registrationStudentAbandonments;
  159.     /**
  160.      * @ORM\Column(type="boolean")
  161.     */
  162.     private $is_abandonned;
  163.     /**
  164.      * @ORM\ManyToOne(targetEntity=RegistrationStudentPreRegistration::class, inversedBy="registrationStudentRegistrations")
  165.      */
  166.     private $registrationStudentPreRegistration;
  167.     /**
  168.      * @ORM\OneToMany(targetEntity=RegistrationTransportCheckpoint::class, mappedBy="registrationStudentRegistration")
  169.      */
  170.     private $registrationTransportCheckpoints;
  171.     /**
  172.      * @ORM\Column(type="boolean")
  173.      */
  174.     private $as_food_restrictions;
  175.     /**
  176.      * @ORM\Column(type="boolean")
  177.      */
  178.     private $is_meatless_menu;
  179.     /**
  180.      * @ORM\Column(type="boolean")
  181.      */
  182.     private $is_menu_without_pork;
  183.     /**
  184.      * @ORM\Column(type="boolean")
  185.      */
  186.     private $is_can_eat_alone;
  187.     /**
  188.      * @ORM\Column(type="boolean")
  189.      */
  190.     private $is_can_do_his_business_alone;
  191.     /**
  192.      * @ORM\Column(type="boolean")
  193.      */
  194.     private $is_falls_sleep_easily;
  195.     /**
  196.      * @ORM\OneToMany(targetEntity=SchoolAbsenceAndDelay::class, mappedBy="studentRegistration")
  197.      */
  198.     private $schoolAbsenceAndDelays;
  199.     /**
  200.      * @ORM\ManyToMany(targetEntity=SettingDocumentToProvide::class, inversedBy="registrationStudentRegistrations")
  201.      */
  202.     private $documentProvides;
  203.     /**
  204.      * @ORM\ManyToMany(targetEntity=CommunicationMessage::class, mappedBy="studentRegistrations")
  205.      */
  206.     private $communicationMessages;
  207.     /**
  208.      * @ORM\Column(type="boolean")
  209.     */
  210.     private $is_new;
  211.     /**
  212.      * @ORM\OneToMany(targetEntity=StockStudentKitEntry::class, mappedBy="registrationStudent")
  213.      */
  214.     private $stockStudentKitEntries;
  215.     /**
  216.      * @ORM\OneToMany(targetEntity=StockKitOut::class, mappedBy="registrationStudent")
  217.      */
  218.     private $stockKitOuts;
  219.     /**
  220.      * @ORM\Column(type="string", length=60, nullable=true)
  221.      */
  222.     private $portal_login;
  223.     /**
  224.      * @ORM\Column(type="string", length=60, nullable=true)
  225.      */
  226.     private $portal_password;
  227.     /**
  228.      * @ORM\OneToMany(targetEntity=AccountingCredit::class, mappedBy="studentRegistration")
  229.      */
  230.     private $accountingCredits;
  231.     /**
  232.      * @ORM\OneToMany(targetEntity=SchoolStudentAverage::class, mappedBy="registrationStudentRegistration")
  233.      */
  234.     private $schoolStudentAverages;
  235.     /**
  236.      * @ORM\OneToMany(targetEntity=NurseryTimeSheet::class, mappedBy="registrationStudentRegistration")
  237.      */
  238.     private $nurseryTimeSheets;
  239.     /**
  240.      * @ORM\OneToMany(targetEntity=SchoolTeacherCallSheetLine::class, mappedBy="registrationStudentRegistration")
  241.      */
  242.     private $schoolTeacherCallSheetLines;
  243.     /**
  244.      * @ORM\OneToMany(targetEntity=AccountingChequeTrackingLine::class, mappedBy="registrationStudentRegistration")
  245.      */
  246.     private $accountingChequeTrackingLines;
  247.     /**
  248.      * @ORM\OneToMany(targetEntity=SchoolReportCardAbsence::class, mappedBy="studentRegistration")
  249.      */
  250.     private $schoolReportCardAbsences;
  251.     /**
  252.      * @ORM\OneToMany(targetEntity=WavePayment::class, mappedBy="studentRegistration")
  253.      */
  254.     private $wavePayments;
  255.     /**
  256.      * @ORM\OneToMany(targetEntity=RegistrationStudentContact::class, mappedBy="registrationStudentRegistration")
  257.      */
  258.     private $registrationStudentContacts;
  259.     /**
  260.      * @ORM\OneToMany(targetEntity=TransportCallSheetLine::class, mappedBy="registrationStudentRegistration")
  261.      */
  262.     private $transportCallSheetLines;
  263.     /**
  264.      * @ORM\OneToMany(targetEntity=StockExitSlip::class, mappedBy="registrationStudentRegistration")
  265.      */
  266.     private $stockExitSlips;
  267.     public function __construct()
  268.     {
  269.         $this->accountingStudentRegistrationFees = new ArrayCollection();
  270.         $this->schoolReportCards = new ArrayCollection();
  271.         $this->schoolAverageReportCards = new ArrayCollection();
  272.         $this->schoolAssessmentByClasses = new ArrayCollection();
  273.         $this->schoolAssessmentByLevels = new ArrayCollection();
  274.         $this->schoolAssessmentByClassByMatters = new ArrayCollection();
  275.         $this->schoolAssessmentByLevelByMatters = new ArrayCollection();
  276.         $this->is_affected false;
  277.         $this->is_diet false;
  278.         $this->is_internal true;
  279.         $this->is_redoubling false;
  280.         $this->is_abandonned false;
  281.         $this->registered_at = new DateTimeImmutable();
  282.         $this->accountingStudentRegistrationPayments = new ArrayCollection();
  283.         $this->registrationClassChanges = new ArrayCollection();
  284.         $this->registrationStudentDowngrades = new ArrayCollection();
  285.         $this->registrationStudentAbandonments = new ArrayCollection();
  286.         $this->registrationTransportCheckpoints = new ArrayCollection();
  287.         $this->as_food_restrictions false;
  288.         $this->is_meatless_menu false;
  289.         $this->is_menu_without_pork false;
  290.         $this->is_can_eat_alone true;
  291.         $this->is_can_do_his_business_alone true;
  292.         $this->is_falls_sleep_easily false;
  293.         $this->schoolAbsenceAndDelays = new ArrayCollection();
  294.         $this->documentProvides = new ArrayCollection();
  295.         $this->communicationMessages = new ArrayCollection();
  296.         $this->is_new false;
  297.         $this->stockStudentKitEntries = new ArrayCollection();
  298.         $this->stockKitOuts = new ArrayCollection();
  299.         $this->accountingCredits = new ArrayCollection();
  300.         $this->schoolStudentAverages = new ArrayCollection();
  301.         $this->nurseryTimeSheets = new ArrayCollection();
  302.         $this->schoolTeacherCallSheetLines = new ArrayCollection();
  303.         $this->accountingChequeTrackingLines = new ArrayCollection();
  304.         $this->schoolReportCardAbsences = new ArrayCollection();
  305.         $this->wavePayments = new ArrayCollection();
  306.         $this->registrationStudentContacts = new ArrayCollection();
  307.         $this->transportCallSheetLines = new ArrayCollection();
  308.         $this->stockExitSlips = new ArrayCollection();
  309.     }
  310.     public function getName()
  311.     {
  312.         return $this->getStudent()->getName();
  313.     }
  314.     public function __toString()
  315.     {
  316.         return $this->getName().' ['.$this->getClassroom()->getLabel().']'.' ['.$this->getStudent()->getRegistrationNumber().']';
  317.     }
  318.     /**
  319.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  320.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  321.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  322.      * must be able to accept an instance of 'File' as the bundle will inject one here
  323.      * during Doctrine hydration.
  324.      *
  325.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  326.      */
  327.     public function setImageFile(?File $imageFile null): void
  328.     {
  329.         $this->imageFile $imageFile;
  330.         if (null !== $imageFile) {
  331.             // It is required that at least one field changes if you are using doctrine
  332.             // otherwise the event listeners won't be called and the file is lost
  333.             $this->updated_at = new \DateTimeImmutable();
  334.         }
  335.     }
  336.     public function getImageFile(): ?File
  337.     {
  338.         return $this->imageFile;
  339.     }
  340.     public function getId(): ?int
  341.     {
  342.         return $this->id;
  343.     }
  344.     public function getEstablishment(): ?Establishment
  345.     {
  346.         return $this->establishment;
  347.     }
  348.     public function setEstablishment(?Establishment $establishment): self
  349.     {
  350.         $this->establishment $establishment;
  351.         return $this;
  352.     }
  353.     public function getStudent(): ?RegistrationStudent
  354.     {
  355.         return $this->student;
  356.     }
  357.     public function setStudent(?RegistrationStudent $student): self
  358.     {
  359.         $this->student $student;
  360.         return $this;
  361.     }
  362.     public function getSchoolYear(): ?SchoolYear
  363.     {
  364.         return $this->schoolYear;
  365.     }
  366.     public function setSchoolYear(?SchoolYear $schoolYear): self
  367.     {
  368.         $this->schoolYear $schoolYear;
  369.         return $this;
  370.     }
  371.     public function getClassroom(): ?SettingClassroom
  372.     {
  373.         return $this->classroom;
  374.     }
  375.     public function setClassroom(?SettingClassroom $classroom): self
  376.     {
  377.         $this->classroom $classroom;
  378.         return $this;
  379.     }
  380.     public function getCreatedAt(): ?\DateTimeImmutable
  381.     {
  382.         return $this->created_at;
  383.     }
  384.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  385.     {
  386.         $this->created_at $created_at;
  387.         return $this;
  388.     }
  389.     public function getUpdatedAt(): ?\DateTimeImmutable
  390.     {
  391.         return $this->updated_at;
  392.     }
  393.     public function setUpdatedAt(\DateTimeImmutable $updated_at): self
  394.     {
  395.         $this->updated_at $updated_at;
  396.         return $this;
  397.     }
  398.     public function getCreatedBy(): ?int
  399.     {
  400.         return $this->created_by;
  401.     }
  402.     public function setCreatedBy(int $created_by): self
  403.     {
  404.         $this->created_by $created_by;
  405.         return $this;
  406.     }
  407.     public function getUpdatedBy(): ?int
  408.     {
  409.         return $this->updated_by;
  410.     }
  411.     public function setUpdatedBy(int $updated_by): self
  412.     {
  413.         $this->updated_by $updated_by;
  414.         return $this;
  415.     }
  416.     /**
  417.      * @return Collection|AccountingStudentRegistrationFee[]
  418.      */
  419.     public function getAccountingStudentRegistrationFees(): Collection
  420.     {
  421.         return $this->accountingStudentRegistrationFees;
  422.     }
  423.     public function addAccountingStudentRegistrationFee(AccountingStudentRegistrationFee $accountingStudentRegistrationFee): self
  424.     {
  425.         if (!$this->accountingStudentRegistrationFees->contains($accountingStudentRegistrationFee)) {
  426.             $this->accountingStudentRegistrationFees[] = $accountingStudentRegistrationFee;
  427.             $accountingStudentRegistrationFee->setStudentRegistration($this);
  428.         }
  429.         return $this;
  430.     }
  431.     public function removeAccountingStudentRegistrationFee(AccountingStudentRegistrationFee $accountingStudentRegistrationFee): self
  432.     {
  433.         if ($this->accountingStudentRegistrationFees->removeElement($accountingStudentRegistrationFee)) {
  434.             // set the owning side to null (unless already changed)
  435.             if ($accountingStudentRegistrationFee->getStudentRegistration() === $this) {
  436.                 $accountingStudentRegistrationFee->setStudentRegistration(null);
  437.             }
  438.         }
  439.         return $this;
  440.     }
  441.     /**
  442.      * @return Collection|SchoolReportCard[]
  443.      */
  444.     public function getSchoolReportCards(): Collection
  445.     {
  446.         return $this->schoolReportCards;
  447.     }
  448.     public function addSchoolReportCard(SchoolReportCard $schoolReportCard): self
  449.     {
  450.         if (!$this->schoolReportCards->contains($schoolReportCard)) {
  451.             $this->schoolReportCards[] = $schoolReportCard;
  452.             $schoolReportCard->setStudentRegistration($this);
  453.         }
  454.         return $this;
  455.     }
  456.    
  457.     public function getOrderedSchoolReportCards(SchoolReportCardRepository $schoolReportCardRepository)
  458.     {
  459.         $schoolReportCards $schoolReportCardRepository->createQueryBuilder('entity')
  460.         ->innerJoin('entity.schoolYearPeriode''schoolYearPeriode')
  461.         ->addSelect('schoolYearPeriode')
  462.         ->andWhere('entity.studentRegistration = :studentRegistration')
  463.         ->setParameter('studentRegistration'$this)
  464.         ->orderBy('schoolYearPeriode.code''ASC')
  465.         ->getQuery()
  466.         ->getResult();
  467.         return $schoolReportCards;
  468.     }
  469.     public function removeSchoolReportCard(SchoolReportCard $schoolReportCard): self
  470.     {
  471.         if ($this->schoolReportCards->removeElement($schoolReportCard)) {
  472.             // set the owning side to null (unless already changed)
  473.             if ($schoolReportCard->getStudentRegistration() === $this) {
  474.                 $schoolReportCard->setStudentRegistration(null);
  475.             }
  476.         }
  477.         return $this;
  478.     }
  479.     /**
  480.      * @return Collection|SchoolAverageReportCard[]
  481.      */
  482.     public function getSchoolAverageReportCards(): Collection
  483.     {
  484.         return $this->schoolAverageReportCards;
  485.     }
  486.     public function addSchoolAverageReportCard(SchoolAverageReportCard $schoolAverageReportCard): self
  487.     {
  488.         if (!$this->schoolAverageReportCards->contains($schoolAverageReportCard)) {
  489.             $this->schoolAverageReportCards[] = $schoolAverageReportCard;
  490.             $schoolAverageReportCard->setStudentRegistration($this);
  491.         }
  492.         return $this;
  493.     }
  494.     public function removeSchoolAverageReportCard(SchoolAverageReportCard $schoolAverageReportCard): self
  495.     {
  496.         if ($this->schoolAverageReportCards->removeElement($schoolAverageReportCard)) {
  497.             // set the owning side to null (unless already changed)
  498.             if ($schoolAverageReportCard->getStudentRegistration() === $this) {
  499.                 $schoolAverageReportCard->setStudentRegistration(null);
  500.             }
  501.         }
  502.         return $this;
  503.     }
  504.     /**
  505.      * @return Collection|SchoolAssessmentByClass[]
  506.      */
  507.     public function getSchoolAssessmentByClasses(): Collection
  508.     {
  509.         return $this->schoolAssessmentByClasses;
  510.     }
  511.     public function addSchoolAssessmentByClass(SchoolAssessmentByClass $schoolAssessmentByClass): self
  512.     {
  513.         if (!$this->schoolAssessmentByClasses->contains($schoolAssessmentByClass)) {
  514.             $this->schoolAssessmentByClasses[] = $schoolAssessmentByClass;
  515.             $schoolAssessmentByClass->setStudentRegistration($this);
  516.         }
  517.         return $this;
  518.     }
  519.     public function removeSchoolAssessmentByClass(SchoolAssessmentByClass $schoolAssessmentByClass): self
  520.     {
  521.         if ($this->schoolAssessmentByClasses->removeElement($schoolAssessmentByClass)) {
  522.             // set the owning side to null (unless already changed)
  523.             if ($schoolAssessmentByClass->getStudentRegistration() === $this) {
  524.                 $schoolAssessmentByClass->setStudentRegistration(null);
  525.             }
  526.         }
  527.         return $this;
  528.     }
  529.     /**
  530.      * @return Collection|SchoolAssessmentByLevel[]
  531.      */
  532.     public function getSchoolAssessmentByLevels(): Collection
  533.     {
  534.         return $this->schoolAssessmentByLevels;
  535.     }
  536.     public function addSchoolAssessmentByLevel(SchoolAssessmentByLevel $schoolAssessmentByLevel): self
  537.     {
  538.         if (!$this->schoolAssessmentByLevels->contains($schoolAssessmentByLevel)) {
  539.             $this->schoolAssessmentByLevels[] = $schoolAssessmentByLevel;
  540.             $schoolAssessmentByLevel->setStudentRegistration($this);
  541.         }
  542.         return $this;
  543.     }
  544.     public function removeSchoolAssessmentByLevel(SchoolAssessmentByLevel $schoolAssessmentByLevel): self
  545.     {
  546.         if ($this->schoolAssessmentByLevels->removeElement($schoolAssessmentByLevel)) {
  547.             // set the owning side to null (unless already changed)
  548.             if ($schoolAssessmentByLevel->getStudentRegistration() === $this) {
  549.                 $schoolAssessmentByLevel->setStudentRegistration(null);
  550.             }
  551.         }
  552.         return $this;
  553.     }
  554.     /**
  555.      * @return Collection|SchoolAssessmentByClassByMatter[]
  556.      */
  557.     public function getSchoolAssessmentByClassByMatters(): Collection
  558.     {
  559.         return $this->schoolAssessmentByClassByMatters;
  560.     }
  561.     public function addSchoolAssessmentByClassByMatter(SchoolAssessmentByClassByMatter $schoolAssessmentByClassByMatter): self
  562.     {
  563.         if (!$this->schoolAssessmentByClassByMatters->contains($schoolAssessmentByClassByMatter)) {
  564.             $this->schoolAssessmentByClassByMatters[] = $schoolAssessmentByClassByMatter;
  565.             $schoolAssessmentByClassByMatter->setStudentRegistration($this);
  566.         }
  567.         return $this;
  568.     }
  569.     public function removeSchoolAssessmentByClassByMatter(SchoolAssessmentByClassByMatter $schoolAssessmentByClassByMatter): self
  570.     {
  571.         if ($this->schoolAssessmentByClassByMatters->removeElement($schoolAssessmentByClassByMatter)) {
  572.             // set the owning side to null (unless already changed)
  573.             if ($schoolAssessmentByClassByMatter->getStudentRegistration() === $this) {
  574.                 $schoolAssessmentByClassByMatter->setStudentRegistration(null);
  575.             }
  576.         }
  577.         return $this;
  578.     }
  579.     /**
  580.      * @return Collection|SchoolAssessmentByLevelByMatter[]
  581.      */
  582.     public function getSchoolAssessmentByLevelByMatters(): Collection
  583.     {
  584.         return $this->schoolAssessmentByLevelByMatters;
  585.     }
  586.     public function addSchoolAssessmentByLevelByMatter(SchoolAssessmentByLevelByMatter $schoolAssessmentByLevelByMatter): self
  587.     {
  588.         if (!$this->schoolAssessmentByLevelByMatters->contains($schoolAssessmentByLevelByMatter)) {
  589.             $this->schoolAssessmentByLevelByMatters[] = $schoolAssessmentByLevelByMatter;
  590.             $schoolAssessmentByLevelByMatter->setStudentRegistration($this);
  591.         }
  592.         return $this;
  593.     }
  594.     public function removeSchoolAssessmentByLevelByMatter(SchoolAssessmentByLevelByMatter $schoolAssessmentByLevelByMatter): self
  595.     {
  596.         if ($this->schoolAssessmentByLevelByMatters->removeElement($schoolAssessmentByLevelByMatter)) {
  597.             // set the owning side to null (unless already changed)
  598.             if ($schoolAssessmentByLevelByMatter->getStudentRegistration() === $this) {
  599.                 $schoolAssessmentByLevelByMatter->setStudentRegistration(null);
  600.             }
  601.         }
  602.         return $this;
  603.     }
  604.     public function getIsRedoubling(): ?bool
  605.     {
  606.         return $this->is_redoubling;
  607.     }
  608.     public function setIsRedoubling(bool $is_redoubling): self
  609.     {
  610.         $this->is_redoubling $is_redoubling;
  611.         return $this;
  612.     }
  613.     public function getIsDiet(): ?bool
  614.     {
  615.         return $this->is_diet;
  616.     }
  617.     public function setIsDiet(bool $is_diet): self
  618.     {
  619.         $this->is_diet $is_diet;
  620.         return $this;
  621.     }
  622.     public function getIsInternal(): ?bool
  623.     {
  624.         return $this->is_internal;
  625.     }
  626.     public function setIsInternal(bool $is_internal): self
  627.     {
  628.         $this->is_internal $is_internal;
  629.         return $this;
  630.     }
  631.     public function getIsAffected(): ?bool
  632.     {
  633.         return $this->is_affected;
  634.     }
  635.     public function setIsAffected(bool $is_affected): self
  636.     {
  637.         $this->is_affected $is_affected;
  638.         return $this;
  639.     }
  640.     public function getRegisteredAt(): ?\DateTimeImmutable
  641.     {
  642.         return $this->registered_at;
  643.     }
  644.     public function setRegisteredAt(\DateTimeImmutable $registered_at): self
  645.     {
  646.         $this->registered_at $registered_at;
  647.         return $this;
  648.     }
  649.     public function getGleAmount(){
  650.         $amount 0;
  651.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $fee) {
  652.             if (!$fee->getIsArchived()) {
  653.                 $amount $amount $fee->getAmount();
  654.             }
  655.         }
  656.         return $amount;
  657.     }
  658.     public function getAmountPaid(){
  659.         $amount 0;
  660.         foreach ($this->getAccountingStudentRegistrationPayments() as $key => $accountingStudentRegistrationPayment) {
  661.             //if (!$accountingStudentRegistrationPayment->isCanBeShow()) {
  662.                 $amount $amount $accountingStudentRegistrationPayment->getAmount();
  663.             //}
  664.         }
  665.         $payArchived 0;
  666.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  667.             if ($accountingStudentRegistrationFee->getIsArchived()) {
  668.                 $payArchived $payArchived $accountingStudentRegistrationFee->getAmountPaid();
  669.             }
  670.             
  671.         }
  672.         return $amount $payArchived;
  673.     }
  674.     public function getAmountCancel(): ?float
  675.     {
  676.         $amountCancel 0;
  677.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  678.             //if (!$accountingStudentRegistrationFee->getIsArchived()) {
  679.                 $amountCancel $amountCancel $accountingStudentRegistrationFee->getAmountReported();
  680.             //}
  681.         }
  682.         
  683.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  684.             if (!$accountingStudentRegistrationFee->getIsArchived()) {
  685.                 $amountCancel $amountCancel $accountingStudentRegistrationFee->getAmountCancel();
  686.             }
  687.         }
  688.         
  689.         return $amountCancel;
  690.     }
  691.     public function getAmountRest(): ?float
  692.     {
  693.         $amount = ($this->getGleAmount() - ($this->getAmountPaid() + $this->getAmountCancel()));
  694.         return $amount $amount 0;
  695.     }
  696.     /**
  697.      * @return Collection|AccountingStudentRegistrationPayment[]
  698.      */
  699.     public function getAccountingStudentRegistrationPayments(): Collection
  700.     {
  701.         return $this->accountingStudentRegistrationPayments;
  702.     }
  703.     public function addAccountingStudentRegistrationPayment(AccountingStudentRegistrationPayment $accountingStudentRegistrationPayment): self
  704.     {
  705.         if (!$this->accountingStudentRegistrationPayments->contains($accountingStudentRegistrationPayment)) {
  706.             $this->accountingStudentRegistrationPayments[] = $accountingStudentRegistrationPayment;
  707.             $accountingStudentRegistrationPayment->setStudentRegistration($this);
  708.         }
  709.         return $this;
  710.     }
  711.     public function removeAccountingStudentRegistrationPayment(AccountingStudentRegistrationPayment $accountingStudentRegistrationPayment): self
  712.     {
  713.         if ($this->accountingStudentRegistrationPayments->removeElement($accountingStudentRegistrationPayment)) {
  714.             // set the owning side to null (unless already changed)
  715.             if ($accountingStudentRegistrationPayment->getStudentRegistration() === $this) {
  716.                 $accountingStudentRegistrationPayment->setStudentRegistration(null);
  717.             }
  718.         }
  719.         return $this;
  720.     }
  721.     public function getLastAmountPaid(): ?float
  722.     {
  723.         return $this->last_amount_paid;
  724.     }
  725.     public function setLastAmountPaid(?float $last_amount_paid): self
  726.     {
  727.         $this->last_amount_paid $last_amount_paid;
  728.         return $this;
  729.     }
  730.     public function getLastPaymentId(): ?int
  731.     {
  732.         return $this->last_payment_id;
  733.     }
  734.     public function setLastPaymentId(?int $last_payment_id): self
  735.     {
  736.         $this->last_payment_id $last_payment_id;
  737.         return $this;
  738.     }
  739.     public function getLastPaymentAt(): ?\DateTimeImmutable
  740.     {
  741.         return $this->last_payment_at;
  742.     }
  743.     public function setLastPaymentAt(?\DateTimeImmutable $last_payment_at): self
  744.     {
  745.         $this->last_payment_at $last_payment_at;
  746.         return $this;
  747.     }
  748.     public function getImage(): ?string
  749.     {
  750.         return $this->image;
  751.     }
  752.     public function setImage(?string $image): self
  753.     {
  754.         $this->image $image;
  755.         return $this;
  756.     }
  757.     /**
  758.      * @return Collection|RegistrationClassChange[]
  759.      */
  760.     public function getRegistrationClassChanges(): Collection
  761.     {
  762.         return $this->registrationClassChanges;
  763.     }
  764.     public function addRegistrationClassChange(RegistrationClassChange $registrationClassChange): self
  765.     {
  766.         if (!$this->registrationClassChanges->contains($registrationClassChange)) {
  767.             $this->registrationClassChanges[] = $registrationClassChange;
  768.             $registrationClassChange->setStudentRegistration($this);
  769.         }
  770.         return $this;
  771.     }
  772.     public function removeRegistrationClassChange(RegistrationClassChange $registrationClassChange): self
  773.     {
  774.         if ($this->registrationClassChanges->removeElement($registrationClassChange)) {
  775.             // set the owning side to null (unless already changed)
  776.             if ($registrationClassChange->getStudentRegistration() === $this) {
  777.                 $registrationClassChange->setStudentRegistration(null);
  778.             }
  779.         }
  780.         return $this;
  781.     }
  782.     /**
  783.      * @return Collection|RegistrationStudentDowngrade[]
  784.      */
  785.     public function getRegistrationStudentDowngrades(): Collection
  786.     {
  787.         return $this->registrationStudentDowngrades;
  788.     }
  789.     public function addRegistrationStudentDowngrade(RegistrationStudentDowngrade $registrationStudentDowngrade): self
  790.     {
  791.         if (!$this->registrationStudentDowngrades->contains($registrationStudentDowngrade)) {
  792.             $this->registrationStudentDowngrades[] = $registrationStudentDowngrade;
  793.             $registrationStudentDowngrade->setRegistrationStudentRegistration($this);
  794.         }
  795.         return $this;
  796.     }
  797.     public function removeRegistrationStudentDowngrade(RegistrationStudentDowngrade $registrationStudentDowngrade): self
  798.     {
  799.         if ($this->registrationStudentDowngrades->removeElement($registrationStudentDowngrade)) {
  800.             // set the owning side to null (unless already changed)
  801.             if ($registrationStudentDowngrade->getRegistrationStudentRegistration() === $this) {
  802.                 $registrationStudentDowngrade->setRegistrationStudentRegistration(null);
  803.             }
  804.         }
  805.         return $this;
  806.     }
  807.     /**
  808.      * @return Collection|RegistrationStudentAbandonment[]
  809.      */
  810.     public function getRegistrationStudentAbandonments(): Collection
  811.     {
  812.         return $this->registrationStudentAbandonments;
  813.     }
  814.     public function addRegistrationStudentAbandonment(RegistrationStudentAbandonment $registrationStudentAbandonment): self
  815.     {
  816.         if (!$this->registrationStudentAbandonments->contains($registrationStudentAbandonment)) {
  817.             $this->registrationStudentAbandonments[] = $registrationStudentAbandonment;
  818.             $registrationStudentAbandonment->setRegistrationStudentRegistration($this);
  819.         }
  820.         return $this;
  821.     }
  822.     public function removeRegistrationStudentAbandonment(RegistrationStudentAbandonment $registrationStudentAbandonment): self
  823.     {
  824.         if ($this->registrationStudentAbandonments->removeElement($registrationStudentAbandonment)) {
  825.             // set the owning side to null (unless already changed)
  826.             if ($registrationStudentAbandonment->getRegistrationStudentRegistration() === $this) {
  827.                 $registrationStudentAbandonment->setRegistrationStudentRegistration(null);
  828.             }
  829.         }
  830.         return $this;
  831.     }
  832.     public function getIsAbandonned(): ?bool
  833.     {
  834.         return $this->is_abandonned;
  835.     }
  836.     public function setIsAbandonned(bool $is_abandonned): self
  837.     {
  838.         $this->is_abandonned $is_abandonned;
  839.         return $this;
  840.     }
  841.     public function getRegistrationStudentPreRegistration(): ?RegistrationStudentPreRegistration
  842.     {
  843.         return $this->registrationStudentPreRegistration;
  844.     }
  845.     public function setRegistrationStudentPreRegistration(?RegistrationStudentPreRegistration $registrationStudentPreRegistration): self
  846.     {
  847.         $this->registrationStudentPreRegistration $registrationStudentPreRegistration;
  848.         return $this;
  849.     }
  850.     /**
  851.      * @return Collection|RegistrationTransportCheckpoint[]
  852.      */
  853.     public function getRegistrationTransportCheckpoints(): Collection
  854.     {
  855.         return $this->registrationTransportCheckpoints;
  856.     }
  857.     public function addRegistrationTransportCheckpoint(RegistrationTransportCheckpoint $registrationTransportCheckpoint): self
  858.     {
  859.         if (!$this->registrationTransportCheckpoints->contains($registrationTransportCheckpoint)) {
  860.             $this->registrationTransportCheckpoints[] = $registrationTransportCheckpoint;
  861.             $registrationTransportCheckpoint->setRegistrationStudentRegistration($this);
  862.         }
  863.         return $this;
  864.     }
  865.     public function removeRegistrationTransportCheckpoint(RegistrationTransportCheckpoint $registrationTransportCheckpoint): self
  866.     {
  867.         if ($this->registrationTransportCheckpoints->removeElement($registrationTransportCheckpoint)) {
  868.             // set the owning side to null (unless already changed)
  869.             if ($registrationTransportCheckpoint->getRegistrationStudentRegistration() === $this) {
  870.                 $registrationTransportCheckpoint->setRegistrationStudentRegistration(null);
  871.             }
  872.         }
  873.         return $this;
  874.     }
  875.     public function hasTransportFee(){
  876.         $reponse false;
  877.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  878.             if ($accountingStudentRegistrationFee->getFee()->getCategory() == SettingFee::TRANSPORT_FEE && !$accountingStudentRegistrationFee->getIsCancel() && $accountingStudentRegistrationFee->getAmountPaid() > && !$accountingStudentRegistrationFee->getIsArchived()) {
  879.                 $reponse true;
  880.                 break;
  881.             }
  882.         }
  883.         return $reponse;
  884.     }
  885.     public function hasGardeMidiFee(){
  886.         $reponse false;
  887.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  888.             if ($accountingStudentRegistrationFee->getFee()->getCategory() == SettingFee::GARDE_MIDI_FEE && !$accountingStudentRegistrationFee->getIsCancel()) {
  889.                 $reponse true;
  890.                 break;
  891.             }
  892.         }
  893.         return $reponse;
  894.     }
  895.     public function hasExtraFee(){
  896.         $reponse false;
  897.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  898.             if ($accountingStudentRegistrationFee->getFee()->getCategory() == SettingFee::ACTIVITE_EXTAT_FEE && !$accountingStudentRegistrationFee->getIsCancel()) {
  899.                 $reponse true;
  900.                 break;
  901.             }
  902.         }
  903.         return $reponse;
  904.     }
  905.     public function hasCanteenFee(){
  906.         $reponse false;
  907.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  908.             if ($accountingStudentRegistrationFee->getFee()->getCategory() == SettingFee::CANTINE_FEE && !$accountingStudentRegistrationFee->getIsCancel()) {
  909.                 $reponse true;
  910.                 break;
  911.             }
  912.         }
  913.         return $reponse;
  914.     }
  915.     public function hasMobileApp(){
  916.         $reponse false;
  917.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  918.             if ($accountingStudentRegistrationFee->getFee()->getCategory() == SettingFee::MOBILE_APP && !$accountingStudentRegistrationFee->getIsCancel()) {
  919.                 $reponse true;
  920.                 break;
  921.             }
  922.         }
  923.         return $reponse;
  924.     }
  925.     public function getAmountDueAt(DateTimeImmutable $dueDate$category '0'){
  926.         
  927.         $amountDue 0;
  928.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  929.             if (!$accountingStudentRegistrationFee->getIsArchived()) {
  930.                 foreach ($accountingStudentRegistrationFee->getAccountingStudentRegistrationFeeSheduls() as $key => $accountingStudentRegistrationFeeShedul) {
  931.                     if ($accountingStudentRegistrationFeeShedul->getDateDue() <= $dueDate && $accountingStudentRegistrationFeeShedul->getAmountRest() >= 0) {
  932.                         if ('0' != $category) {
  933.                             if ($accountingStudentRegistrationFee->getFee()->getCategory() == $category) {
  934.                                 $amountDue $amountDue $accountingStudentRegistrationFeeShedul->getAmountRest();
  935.                             }
  936.                         }else {
  937.                             $amountDue $amountDue $accountingStudentRegistrationFeeShedul->getAmountRest();
  938.                         }
  939.                     }
  940.                 }
  941.             }
  942.         }
  943.         $amountChequeTracking 0;
  944.         foreach ($this->getAccountingChequeTrackingLines() as $key => $accountingChequeTrackingLine) {
  945.             if ($accountingChequeTrackingLine->getAccountingChequeTracking()->getStatus() == AccountingChequeTracking::EN_TRAITEMENT) {
  946.                 $amountChequeTracking += $accountingChequeTrackingLine->getAmount();
  947.             }
  948.         }
  949.         
  950.         return $amountDue $amountChequeTracking;
  951.     }
  952.     public function getAmountDueAtByFee(DateTimeImmutable $dueDateSettingFee $settingFee){
  953.         
  954.         $amountDue 0;
  955.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  956.             if (!$accountingStudentRegistrationFee->getIsArchived()) {
  957.                 foreach ($accountingStudentRegistrationFee->getAccountingStudentRegistrationFeeSheduls() as $key => $accountingStudentRegistrationFeeShedul) {
  958.                     if ($accountingStudentRegistrationFeeShedul->getDateDue() <= $dueDate && $accountingStudentRegistrationFeeShedul->getAmountRest() > 0) {
  959.                         if ($accountingStudentRegistrationFee->getFee() == $settingFee) {
  960.                             $amountDue $amountDue $accountingStudentRegistrationFeeShedul->getAmountRest();
  961.                         }
  962.                     }
  963.                 }
  964.             }
  965.         }
  966.         
  967.         return $amountDue;
  968.     }
  969.     public function getAmountByFee(SettingFee $settingFee){
  970.         
  971.         $amountDue 0;
  972.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  973.             if (!$accountingStudentRegistrationFee->getIsArchived()) {
  974.                 foreach ($accountingStudentRegistrationFee->getAccountingStudentRegistrationFeeSheduls() as $key => $accountingStudentRegistrationFeeShedul) {
  975.                     //if ($accountingStudentRegistrationFeeShedul->getDateDue() <= $dueDate && $accountingStudentRegistrationFeeShedul->getAmountRest() > 0) {
  976.                         if ($accountingStudentRegistrationFee->getFee() == $settingFee) {
  977.                             $amountDue $amountDue $accountingStudentRegistrationFeeShedul->getAmount();
  978.                         }
  979.                     //}
  980.                 }
  981.             }
  982.         }
  983.         
  984.         return $amountDue;
  985.     }
  986.     public function getAmountPaidByFee(SettingFee $settingFee){
  987.         
  988.         $amountDue 0;
  989.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  990.             if (!$accountingStudentRegistrationFee->getIsArchived()) {
  991.                 foreach ($accountingStudentRegistrationFee->getAccountingStudentRegistrationFeeSheduls() as $key => $accountingStudentRegistrationFeeShedul) {
  992.                     //if ($accountingStudentRegistrationFeeShedul->getDateDue() <= $dueDate && $accountingStudentRegistrationFeeShedul->getAmountRest() > 0) {
  993.                         if ($accountingStudentRegistrationFee->getFee() == $settingFee) {
  994.                             $amountDue $amountDue $accountingStudentRegistrationFeeShedul->getAmountPaid();
  995.                         }
  996.                     //}
  997.                 }
  998.             }
  999.         }
  1000.         
  1001.         return $amountDue;
  1002.     }
  1003.     public function getAmountRestByFee(SettingFee $settingFee){
  1004.         
  1005.         $amountDue 0;
  1006.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  1007.             if (!$accountingStudentRegistrationFee->getIsArchived()) {
  1008.                 foreach ($accountingStudentRegistrationFee->getAccountingStudentRegistrationFeeSheduls() as $key => $accountingStudentRegistrationFeeShedul) {
  1009.                     //if ($accountingStudentRegistrationFeeShedul->getDateDue() <= $dueDate && $accountingStudentRegistrationFeeShedul->getAmountRest() > 0) {
  1010.                         if ($accountingStudentRegistrationFee->getFee() == $settingFee) {
  1011.                             $amountDue $amountDue $accountingStudentRegistrationFeeShedul->getAmountRest();
  1012.                         }
  1013.                     //}
  1014.                 }
  1015.             }
  1016.         }
  1017.         
  1018.         return $amountDue;
  1019.     }
  1020.     public function getFeeShedulDues(DateTimeImmutable $dueDate){
  1021.         $feeShedulDues = new ArrayCollection();
  1022.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  1023.             if (!$accountingStudentRegistrationFee->getIsArchived()) {
  1024.                 foreach ($accountingStudentRegistrationFee->getAccountingStudentRegistrationFeeSheduls() as $key => $accountingStudentRegistrationFeeShedul) {
  1025.                     if ($accountingStudentRegistrationFeeShedul->getDateDue() <= $dueDate && $accountingStudentRegistrationFeeShedul->getAmountRest() > 0) {
  1026.                         $feeShedulDues->add($accountingStudentRegistrationFeeShedul);
  1027.                     }
  1028.                 }
  1029.             }
  1030.         }
  1031.         
  1032.         return $feeShedulDues;
  1033.     }
  1034.     public function getAsFoodRestrictions(): ?bool
  1035.     {
  1036.         return $this->as_food_restrictions;
  1037.     }
  1038.     public function setAsFoodRestrictions(bool $as_food_restrictions): self
  1039.     {
  1040.         $this->as_food_restrictions $as_food_restrictions;
  1041.         return $this;
  1042.     }
  1043.     public function getIsMeatlessMenu(): ?bool
  1044.     {
  1045.         return $this->is_meatless_menu;
  1046.     }
  1047.     public function setIsMeatlessMenu(bool $is_meatless_menu): self
  1048.     {
  1049.         $this->is_meatless_menu $is_meatless_menu;
  1050.         return $this;
  1051.     }
  1052.     public function getIsMenuWithoutPork(): ?bool
  1053.     {
  1054.         return $this->is_menu_without_pork;
  1055.     }
  1056.     public function setIsMenuWithoutPork(bool $is_menu_without_pork): self
  1057.     {
  1058.         $this->is_menu_without_pork $is_menu_without_pork;
  1059.         return $this;
  1060.     }
  1061.     public function getIsCanEatAlone(): ?bool
  1062.     {
  1063.         return $this->is_can_eat_alone;
  1064.     }
  1065.     public function setIsCanEatAlone(bool $is_can_eat_alone): self
  1066.     {
  1067.         $this->is_can_eat_alone $is_can_eat_alone;
  1068.         return $this;
  1069.     }
  1070.     public function getIsCanDoHisBusinessAlone(): ?bool
  1071.     {
  1072.         return $this->is_can_do_his_business_alone;
  1073.     }
  1074.     public function setIsCanDoHisBusinessAlone(bool $is_can_do_his_business_alone): self
  1075.     {
  1076.         $this->is_can_do_his_business_alone $is_can_do_his_business_alone;
  1077.         return $this;
  1078.     }
  1079.     public function getIsFallsSleepEasily(): ?bool
  1080.     {
  1081.         return $this->is_falls_sleep_easily;
  1082.     }
  1083.     public function setIsFallsSleepEasily(bool $is_falls_sleep_easily): self
  1084.     {
  1085.         $this->is_falls_sleep_easily $is_falls_sleep_easily;
  1086.         return $this;
  1087.     }
  1088.     /**
  1089.      * @return Collection|SchoolAbsenceAndDelay[]
  1090.      */
  1091.     public function getSchoolAbsenceAndDelays(): Collection
  1092.     {
  1093.         return $this->schoolAbsenceAndDelays;
  1094.     }
  1095.     public function addSchoolAbsenceAndDelay(SchoolAbsenceAndDelay $schoolAbsenceAndDelay): self
  1096.     {
  1097.         if (!$this->schoolAbsenceAndDelays->contains($schoolAbsenceAndDelay)) {
  1098.             $this->schoolAbsenceAndDelays[] = $schoolAbsenceAndDelay;
  1099.             $schoolAbsenceAndDelay->setStudentRegistration($this);
  1100.         }
  1101.         return $this;
  1102.     }
  1103.     public function removeSchoolAbsenceAndDelay(SchoolAbsenceAndDelay $schoolAbsenceAndDelay): self
  1104.     {
  1105.         if ($this->schoolAbsenceAndDelays->removeElement($schoolAbsenceAndDelay)) {
  1106.             // set the owning side to null (unless already changed)
  1107.             if ($schoolAbsenceAndDelay->getStudentRegistration() === $this) {
  1108.                 $schoolAbsenceAndDelay->setStudentRegistration(null);
  1109.             }
  1110.         }
  1111.         return $this;
  1112.     }
  1113.     public function getDelayByPeriode(SchoolYearPeriode $schoolYearPeriode){
  1114.         $minute 0;
  1115.         $heure 0;
  1116.         foreach ($this->getSchoolAbsenceAndDelays() as $key => $schoolAbsenceAndDelay) {
  1117.             if ($schoolAbsenceAndDelay->getSchoolYearPeriode() == $schoolYearPeriode) {
  1118.                 if ($schoolAbsenceAndDelay->getSituation() == 'RETARD') {
  1119.                     if ($schoolAbsenceAndDelay->getDurationType() == 'MINUTE') {
  1120.                         $minute += $schoolAbsenceAndDelay->getDuration();
  1121.                     }
  1122.                     if ($schoolAbsenceAndDelay->getDurationType() == 'HEURE') {
  1123.                         $heure += $schoolAbsenceAndDelay->getDuration();
  1124.                     }
  1125.                 }
  1126.             }
  1127.         }
  1128.         $heure ceil($heure + ($minute 60));
  1129.         
  1130.         return $heure;
  1131.     }
  1132.     public function getAbsenceByPeriode(SchoolYearPeriode $schoolYearPeriode){
  1133.         $minute 0;
  1134.         $heure 0;
  1135.         foreach ($this->getSchoolAbsenceAndDelays() as $key => $schoolAbsenceAndDelay) {
  1136.             if ($schoolAbsenceAndDelay->getSchoolYearPeriode() == $schoolYearPeriode) {
  1137.                 if ($schoolAbsenceAndDelay->getSituation() == 'ABSENCE') {
  1138.                     if ($schoolAbsenceAndDelay->getDurationType() == 'MINUTE') {
  1139.                         $minute += $schoolAbsenceAndDelay->getDuration();
  1140.                     }
  1141.                     if ($schoolAbsenceAndDelay->getDurationType() == 'HEURE') {
  1142.                         $heure += $schoolAbsenceAndDelay->getDuration();
  1143.                     }
  1144.                 }
  1145.             }
  1146.         }
  1147.         $heure ceil($heure + ($minute 60));
  1148.         
  1149.         return $heure;
  1150.     }
  1151.     /**
  1152.      * @return Collection|SettingDocumentToProvide[]
  1153.      */
  1154.     public function getDocumentProvides(): Collection
  1155.     {
  1156.         return $this->documentProvides;
  1157.     }
  1158.     public function addDocumentProvide(SettingDocumentToProvide $documentProvide): self
  1159.     {
  1160.         if (!$this->documentProvides->contains($documentProvide)) {
  1161.             $this->documentProvides[] = $documentProvide;
  1162.         }
  1163.         return $this;
  1164.     }
  1165.     public function removeDocumentProvide(SettingDocumentToProvide $documentProvide): self
  1166.     {
  1167.         $this->documentProvides->removeElement($documentProvide);
  1168.         return $this;
  1169.     }
  1170.     /**
  1171.      * @return Collection|CommunicationMessage[]
  1172.      */
  1173.     public function getCommunicationMessages(): Collection
  1174.     {
  1175.         return $this->communicationMessages;
  1176.     }
  1177.     public function addCommunicationMessage(CommunicationMessage $communicationMessage): self
  1178.     {
  1179.         if (!$this->communicationMessages->contains($communicationMessage)) {
  1180.             $this->communicationMessages[] = $communicationMessage;
  1181.             $communicationMessage->addStudentRegistration($this);
  1182.         }
  1183.         return $this;
  1184.     }
  1185.     public function removeCommunicationMessage(CommunicationMessage $communicationMessage): self
  1186.     {
  1187.         if ($this->communicationMessages->removeElement($communicationMessage)) {
  1188.             $communicationMessage->removeStudentRegistration($this);
  1189.         }
  1190.         return $this;
  1191.     }
  1192.     public function getIsNew(): ?bool
  1193.     {
  1194.         return $this->is_new;
  1195.     }
  1196.     public function setIsNew(bool $is_new): self
  1197.     {
  1198.         $this->is_new $is_new;
  1199.         return $this;
  1200.     }
  1201.     /**
  1202.      * @return Collection|StockStudentKitEntry[]
  1203.      */
  1204.     public function getStockStudentKitEntries(): Collection
  1205.     {
  1206.         return $this->stockStudentKitEntries;
  1207.     }
  1208.     public function addStockStudentKitEntry(StockStudentKitEntry $stockStudentKitEntry): self
  1209.     {
  1210.         if (!$this->stockStudentKitEntries->contains($stockStudentKitEntry)) {
  1211.             $this->stockStudentKitEntries[] = $stockStudentKitEntry;
  1212.             $stockStudentKitEntry->setRegistrationStudent($this);
  1213.         }
  1214.         return $this;
  1215.     }
  1216.     public function removeStockStudentKitEntry(StockStudentKitEntry $stockStudentKitEntry): self
  1217.     {
  1218.         if ($this->stockStudentKitEntries->removeElement($stockStudentKitEntry)) {
  1219.             // set the owning side to null (unless already changed)
  1220.             if ($stockStudentKitEntry->getRegistrationStudent() === $this) {
  1221.                 $stockStudentKitEntry->setRegistrationStudent(null);
  1222.             }
  1223.         }
  1224.         return $this;
  1225.     }
  1226.     /**
  1227.      * @return Collection|StockKitOut[]
  1228.      */
  1229.     public function getStockKitOuts(): Collection
  1230.     {
  1231.         return $this->stockKitOuts;
  1232.     }
  1233.     public function addStockKitOut(StockKitOut $stockKitOut): self
  1234.     {
  1235.         if (!$this->stockKitOuts->contains($stockKitOut)) {
  1236.             $this->stockKitOuts[] = $stockKitOut;
  1237.             $stockKitOut->setRegistrationStudent($this);
  1238.         }
  1239.         return $this;
  1240.     }
  1241.     public function removeStockKitOut(StockKitOut $stockKitOut): self
  1242.     {
  1243.         if ($this->stockKitOuts->removeElement($stockKitOut)) {
  1244.             // set the owning side to null (unless already changed)
  1245.             if ($stockKitOut->getRegistrationStudent() === $this) {
  1246.                 $stockKitOut->setRegistrationStudent(null);
  1247.             }
  1248.         }
  1249.         return $this;
  1250.     }
  1251.     public function getPortalLogin(): ?string
  1252.     {
  1253.         return $this->portal_login;
  1254.     }
  1255.     public function setPortalLogin(?string $portal_login): self
  1256.     {
  1257.         $this->portal_login $portal_login;
  1258.         return $this;
  1259.     }
  1260.     public function getPortalPassword(): ?string
  1261.     {
  1262.         return $this->portal_password;
  1263.     }
  1264.     public function setPortalPassword(?string $portal_password): self
  1265.     {
  1266.         $this->portal_password $portal_password;
  1267.         return $this;
  1268.     }
  1269.     /**
  1270.      * @return Collection|AccountingCredit[]
  1271.      */
  1272.     public function getAccountingCredits(): Collection
  1273.     {
  1274.         return $this->accountingCredits;
  1275.     }
  1276.     public function addAccountingCredit(AccountingCredit $accountingCredit): self
  1277.     {
  1278.         if (!$this->accountingCredits->contains($accountingCredit)) {
  1279.             $this->accountingCredits[] = $accountingCredit;
  1280.             $accountingCredit->setStudentRegistration($this);
  1281.         }
  1282.         return $this;
  1283.     }
  1284.     public function removeAccountingCredit(AccountingCredit $accountingCredit): self
  1285.     {
  1286.         if ($this->accountingCredits->removeElement($accountingCredit)) {
  1287.             // set the owning side to null (unless already changed)
  1288.             if ($accountingCredit->getStudentRegistration() === $this) {
  1289.                 $accountingCredit->setStudentRegistration(null);
  1290.             }
  1291.         }
  1292.         return $this;
  1293.     }
  1294.     /**
  1295.      * @return Collection|SchoolStudentAverage[]
  1296.      */
  1297.     public function getSchoolStudentAverages(): Collection
  1298.     {
  1299.         return $this->schoolStudentAverages;
  1300.     }
  1301.     public function addSchoolStudentAverage(SchoolStudentAverage $schoolStudentAverage): self
  1302.     {
  1303.         if (!$this->schoolStudentAverages->contains($schoolStudentAverage)) {
  1304.             $this->schoolStudentAverages[] = $schoolStudentAverage;
  1305.             $schoolStudentAverage->setRegistrationStudentRegistration($this);
  1306.         }
  1307.         return $this;
  1308.     }
  1309.     public function removeSchoolStudentAverage(SchoolStudentAverage $schoolStudentAverage): self
  1310.     {
  1311.         if ($this->schoolStudentAverages->removeElement($schoolStudentAverage)) {
  1312.             // set the owning side to null (unless already changed)
  1313.             if ($schoolStudentAverage->getRegistrationStudentRegistration() === $this) {
  1314.                 $schoolStudentAverage->setRegistrationStudentRegistration(null);
  1315.             }
  1316.         }
  1317.         return $this;
  1318.     }
  1319.     public function computePeriodeAverage(SchoolMatter $schoolMatterReportCard $reportCardSchoolAverageReportCard $schoolAverageReportCard){
  1320.         if (count($schoolMatter->getSchoolSubMatters()) > 0) {
  1321.             $averages 0;
  1322.             $periodeAverage 0;
  1323.             $count 0;
  1324.             $coeffecient 0;
  1325.             foreach ($schoolMatter->getSchoolSubMatters() as $key => $schoolSubMatter) {
  1326.                 $_averages 0;
  1327.                 $_periodeAverage 0;
  1328.                 $_count 0;
  1329.                 $_coeffecient 0;
  1330.                 foreach ($this->getSchoolStudentAverages() as $key => $schoolStudentAverage) {
  1331.                     if ($schoolStudentAverage->getSubMatter() == $schoolSubMatter) {
  1332.                         if ($schoolStudentAverage->getSchoolAverage()->getIsValidated()) {
  1333.                             $schoolAverageReportCard->setSchoolTeacher($schoolStudentAverage->getSchoolAverage()->getSchoolTeacher());
  1334.                             if (!$schoolStudentAverage->getIsUnclassified()) {
  1335.                                 if ($schoolStudentAverage->getSchoolYearPeriode() == $reportCard->getSchoolYearPeriode()) {
  1336.                                     if ($schoolStudentAverage->getSubMatter() != null) {
  1337.                                         if ($schoolStudentAverage->getMatter() == $schoolMatter) {
  1338.                                             $_count ++;
  1339.                                             if ($this->getEstablishment()->getType() == Establishment::ESTABLISHMENT_PRESCOLAIRE_PRIMAIRE_TYPES) {
  1340.                                                 if($schoolStudentAverage->getNote() < 999.0){
  1341.                                                     $averages += $schoolStudentAverage->getNote();
  1342.                                                     //$coeffecient += ($schoolStudentAverage->getNoteOn() / $reportCard->getNoteOn());
  1343.                                                     $_coeffecient += 1;
  1344.                                                 }
  1345.                                             }else {
  1346.                                                 if($schoolStudentAverage->getNote() < 999.0){
  1347.                                                     //$averages += $schoolStudentAverage->getNote() * $schoolStudentAverage->getSubMatter()->getCoefficient();
  1348.                                                     //$coeffecient += $schoolStudentAverage->getSubMatter()->getCoefficient();
  1349.                                                     $_averages += $schoolStudentAverage->getNote();
  1350.                                                     $_coeffecient += ($schoolStudentAverage->getSchoolAverage()->getNoteOn() / 20);
  1351.                                                 }
  1352.                                             }
  1353.                                         }
  1354.                                     }
  1355.                                 }
  1356.                             }
  1357.                         }
  1358.                     }
  1359.                 }
  1360.                 
  1361.                 if ($_coeffecient 0) {
  1362.                     $_periodeAverage $_averages $_coeffecient;
  1363.                     $averages += ($_periodeAverage $schoolSubMatter->getCoefficient()); 
  1364.                     $coeffecient += $schoolSubMatter->getCoefficient(); 
  1365.                 }else {
  1366.                     $_periodeAverage 999;
  1367.                 }
  1368.             }
  1369.             if ($coeffecient 0) {
  1370.                 $periodeAverage $averages $coeffecient;
  1371.             }else {
  1372.                 $periodeAverage 999;
  1373.             }
  1374.             return $periodeAverage;
  1375.         }else {
  1376.             $averages 0;
  1377.             $periodeAverage 0;
  1378.             $count 0;
  1379.             $coeffecient 0;
  1380.             foreach ($this->getSchoolStudentAverages() as $key => $schoolStudentAverage) {
  1381.                 if ($schoolStudentAverage->getSchoolAverage()->getIsValidated()) {
  1382.                     $schoolAverageReportCard->setSchoolTeacher($schoolStudentAverage->getSchoolAverage()->getSchoolTeacher());
  1383.                     if (!$schoolStudentAverage->getIsUnclassified()) {
  1384.                         if ($schoolStudentAverage->getMatter() == $schoolMatter) {
  1385.                             if ($schoolStudentAverage->getSchoolYearPeriode() == $reportCard->getSchoolYearPeriode()) {
  1386.                                 $count++;
  1387.                                 if ($this->getEstablishment()->getType() == Establishment::ESTABLISHMENT_PRESCOLAIRE_PRIMAIRE_TYPES) {
  1388.                                     if($schoolStudentAverage->getNote() < 999.0){
  1389.                                         $averages += $schoolStudentAverage->getNote();
  1390.                                         //$coeffecient += ($schoolStudentAverage->getNoteOn() / $reportCard->getNoteOn());
  1391.                                         $coeffecient += 1;
  1392.                                     }
  1393.                                 }else {
  1394.                                     if($schoolStudentAverage->getNote() < 999.0){
  1395.                                         //$averages += $schoolStudentAverage->getNote() * $schoolStudentAverage->getMatter()->getCoefficient();
  1396.                                         //$coeffecient += $schoolStudentAverage->getMatter()->getCoefficient();
  1397.                                         
  1398.                                         $averages += $schoolStudentAverage->getNote();
  1399.                                         $coeffecient += ($schoolStudentAverage->getSchoolAverage()->getNoteOn() / 20);
  1400.                                     }
  1401.                                 }
  1402.                             }
  1403.                         }
  1404.                     }
  1405.                 }
  1406.             }
  1407.             
  1408.             if ($coeffecient 0) {
  1409.                 $periodeAverage $averages $coeffecient;
  1410.             }else {
  1411.                 $periodeAverage 999;
  1412.             }
  1413.             return $periodeAverage;
  1414.         }
  1415.     }
  1416.     public function computeSubPeriodeAverage(SchoolSubMatter $schoolSubMatterReportCard $reportCardSchoolAverageReportCard $schoolAverageReportCard){
  1417.         $averages 0;
  1418.         $periodeAverage 0;
  1419.         $count 0;
  1420.         $coeffecient 0;
  1421.         
  1422.         foreach ($this->getSchoolStudentAverages() as $key => $schoolStudentAverage) {
  1423.             if ($schoolStudentAverage->getSchoolAverage()->getIsValidated()) {
  1424.                 $schoolAverageReportCard->setSchoolTeacher($schoolStudentAverage->getSchoolAverage()->getSchoolTeacher());
  1425.                 if (!$schoolStudentAverage->getIsUnclassified()) {
  1426.                     if ($schoolStudentAverage->getSubMatter() == $schoolSubMatter && $schoolStudentAverage->getSchoolYearPeriode() == $reportCard->getSchoolYearPeriode()) {
  1427.                         $count++;
  1428.                         if ($this->getEstablishment()->getType() == Establishment::ESTABLISHMENT_PRESCOLAIRE_PRIMAIRE_TYPES) {
  1429.                             if($schoolStudentAverage->getNote() < 999){
  1430.                                 $averages += $schoolStudentAverage->getNote();
  1431.                                 //$coeffecient += ($schoolStudentAverage->getNoteOn() / $reportCard->getNoteOn());
  1432.                                 $coeffecient += 1;
  1433.                             }
  1434.                         }else {
  1435.                             if($schoolStudentAverage->getNote() < 999){
  1436.                                 //$averages += $schoolStudentAverage->getNote() * $schoolSubMatter->getCoefficient();
  1437.                                 //$coeffecient += $schoolSubMatter->getCoefficient();
  1438.                                 $averages += $schoolStudentAverage->getNote();
  1439.                                 $coeffecient += ($schoolStudentAverage->getSchoolAverage()->getNoteOn() / 20);
  1440.                             }
  1441.                         }
  1442.                         
  1443.                     }
  1444.                 }
  1445.             }
  1446.         }
  1447.         
  1448.         if ($coeffecient 0) {
  1449.             $periodeAverage $averages $coeffecient;
  1450.         }else {
  1451.             $periodeAverage 999;
  1452.         }
  1453.         return $periodeAverage;
  1454.     }
  1455.     public function asMatterDone(SchoolMatter $schoolMatterReportCard $reportCard){
  1456.         
  1457.         $count 0;
  1458.         foreach ($this->getSchoolStudentAverages() as $key => $schoolStudentAverage) {
  1459.             if ($schoolStudentAverage->getMatter() == $schoolMatter && $schoolStudentAverage->getSchoolYearPeriode() == $reportCard->getSchoolYearPeriode()) {
  1460.                 
  1461.                 $count++;
  1462.             }
  1463.         }
  1464.         return $count 0;
  1465.     }
  1466.     public function getAnnualAverage(): ?float
  1467.     {
  1468.         $annual_average 0;
  1469.         foreach ($this->getSchoolReportCards() as $key => $schoolReportCard) {
  1470.             $annual_average $schoolReportCard->getAnnualAverage();
  1471.         }
  1472.         return $annual_average;
  1473.     }
  1474.     public function getAnnualRank(): ?string
  1475.     {
  1476.         $annual_rank 0;
  1477.         foreach ($this->getSchoolReportCards() as $key => $schoolReportCard) {
  1478.             $annual_rank $schoolReportCard->getAnnualRank();
  1479.         }
  1480.         return $annual_rank;
  1481.     }
  1482.     /**
  1483.      * @return Collection|NurseryTimeSheet[]
  1484.      */
  1485.     public function getNurseryTimeSheets(): Collection
  1486.     {
  1487.         return $this->nurseryTimeSheets;
  1488.     }
  1489.     public function addNurseryTimeSheet(NurseryTimeSheet $nurseryTimeSheet): self
  1490.     {
  1491.         if (!$this->nurseryTimeSheets->contains($nurseryTimeSheet)) {
  1492.             $this->nurseryTimeSheets[] = $nurseryTimeSheet;
  1493.             $nurseryTimeSheet->setRegistrationStudentRegistration($this);
  1494.         }
  1495.         return $this;
  1496.     }
  1497.     public function removeNurseryTimeSheet(NurseryTimeSheet $nurseryTimeSheet): self
  1498.     {
  1499.         if ($this->nurseryTimeSheets->removeElement($nurseryTimeSheet)) {
  1500.             // set the owning side to null (unless already changed)
  1501.             if ($nurseryTimeSheet->getRegistrationStudentRegistration() === $this) {
  1502.                 $nurseryTimeSheet->setRegistrationStudentRegistration(null);
  1503.             }
  1504.         }
  1505.         return $this;
  1506.     }
  1507.     /**
  1508.      * @return Collection|SchoolTeacherCallSheetLine[]
  1509.      */
  1510.     public function getSchoolTeacherCallSheetLines(): Collection
  1511.     {
  1512.         return $this->schoolTeacherCallSheetLines;
  1513.     }
  1514.     public function addSchoolTeacherCallSheetLine(SchoolTeacherCallSheetLine $schoolTeacherCallSheetLine): self
  1515.     {
  1516.         if (!$this->schoolTeacherCallSheetLines->contains($schoolTeacherCallSheetLine)) {
  1517.             $this->schoolTeacherCallSheetLines[] = $schoolTeacherCallSheetLine;
  1518.             $schoolTeacherCallSheetLine->setRegistrationStudentRegistration($this);
  1519.         }
  1520.         return $this;
  1521.     }
  1522.     public function removeSchoolTeacherCallSheetLine(SchoolTeacherCallSheetLine $schoolTeacherCallSheetLine): self
  1523.     {
  1524.         if ($this->schoolTeacherCallSheetLines->removeElement($schoolTeacherCallSheetLine)) {
  1525.             // set the owning side to null (unless already changed)
  1526.             if ($schoolTeacherCallSheetLine->getRegistrationStudentRegistration() === $this) {
  1527.                 $schoolTeacherCallSheetLine->setRegistrationStudentRegistration(null);
  1528.             }
  1529.         }
  1530.         return $this;
  1531.     }
  1532.     public function getJustifydAbsenceByPeriode(SchoolYearPeriode $schoolYearPeriode){
  1533.         $minute 0;
  1534.         $heure 0;
  1535.         foreach ($this->getSchoolAbsenceAndDelays() as $key => $schoolAbsenceAndDelay) {
  1536.             if ($schoolAbsenceAndDelay->getIsJustify()) {
  1537.                 if ($schoolAbsenceAndDelay->getSchoolYearPeriode() == $schoolYearPeriode) {
  1538.                     if ($schoolAbsenceAndDelay->getSituation() == 'ABSENCE') {
  1539.                         if ($schoolAbsenceAndDelay->getDurationType() == 'MINUTE') {
  1540.                             $minute += $schoolAbsenceAndDelay->getDuration();
  1541.                         }
  1542.                         if ($schoolAbsenceAndDelay->getDurationType() == 'HEURE') {
  1543.                             $heure += $schoolAbsenceAndDelay->getDuration();
  1544.                         }
  1545.                     }
  1546.                 }
  1547.             }
  1548.         }
  1549.         $heure ceil($heure + ($minute 60));
  1550.         
  1551.         return $heure;
  1552.     }
  1553.     public function getNotJustifydAbsenceByPeriode(SchoolYearPeriode $schoolYearPeriode){
  1554.         $minute 0;
  1555.         $heure 0;
  1556.         foreach ($this->getSchoolAbsenceAndDelays() as $key => $schoolAbsenceAndDelay) {
  1557.             if (!$schoolAbsenceAndDelay->getIsJustify()) {
  1558.                 if ($schoolAbsenceAndDelay->getSchoolYearPeriode() == $schoolYearPeriode) {
  1559.                     if ($schoolAbsenceAndDelay->getSituation() == 'ABSENCE') {
  1560.                         if ($schoolAbsenceAndDelay->getDurationType() == 'MINUTE') {
  1561.                             $minute += $schoolAbsenceAndDelay->getDuration();
  1562.                         }
  1563.                         if ($schoolAbsenceAndDelay->getDurationType() == 'HEURE') {
  1564.                             $heure += $schoolAbsenceAndDelay->getDuration();
  1565.                         }
  1566.                     }
  1567.                 }
  1568.             }
  1569.         }
  1570.         $heure ceil($heure + ($minute 60));
  1571.         
  1572.         return $heure;
  1573.     }
  1574.     public function isReported(){
  1575.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  1576.             if ($accountingStudentRegistrationFee->getIsReported()) {
  1577.                 return true;
  1578.                 break;
  1579.             }
  1580.         }
  1581.         return false;
  1582.     }
  1583.     public function getNurseryPresence(DateTimeImmutable $startDateDateTimeImmutable $endDate){
  1584.         
  1585.         $data = new ArrayCollection();
  1586.         foreach ($this->getSchoolTeacherCallSheetLines() as $key => $schoolTeacherCallSheetLine) {
  1587.             if ($startDate <= $schoolTeacherCallSheetLine->getCreateDate() && $schoolTeacherCallSheetLine->getCreateDate() <= $endDate) {
  1588.                 $data->add($schoolTeacherCallSheetLine);
  1589.             }
  1590.         }
  1591.         return $data;
  1592.     }
  1593.     /**
  1594.      * @return Collection|AccountingChequeTrackingLine[]
  1595.      */
  1596.     public function getAccountingChequeTrackingLines(): Collection
  1597.     {
  1598.         return $this->accountingChequeTrackingLines;
  1599.     }
  1600.     public function addAccountingChequeTrackingLine(AccountingChequeTrackingLine $accountingChequeTrackingLine): self
  1601.     {
  1602.         if (!$this->accountingChequeTrackingLines->contains($accountingChequeTrackingLine)) {
  1603.             $this->accountingChequeTrackingLines[] = $accountingChequeTrackingLine;
  1604.             $accountingChequeTrackingLine->setRegistrationStudentRegistration($this);
  1605.         }
  1606.         return $this;
  1607.     }
  1608.     public function removeAccountingChequeTrackingLine(AccountingChequeTrackingLine $accountingChequeTrackingLine): self
  1609.     {
  1610.         if ($this->accountingChequeTrackingLines->removeElement($accountingChequeTrackingLine)) {
  1611.             // set the owning side to null (unless already changed)
  1612.             if ($accountingChequeTrackingLine->getRegistrationStudentRegistration() === $this) {
  1613.                 $accountingChequeTrackingLine->setRegistrationStudentRegistration(null);
  1614.             }
  1615.         }
  1616.         return $this;
  1617.     }
  1618.     public function getAbsenceStatus($day){
  1619.         $nb 0;
  1620.         foreach ($this->getSchoolTeacherCallSheetLines() as $key => $schoolTeacherCallSheetLine) {
  1621.             //if ($day == $schoolTeacherCallSheetLine->getCreateDate()->format('Y-m-d') && $schoolTeacherCallSheetLine->getSchoolTeacherCallSheet()->getSettingTimeTable() == $settingTimeTable) {
  1622.             if ($day == $schoolTeacherCallSheetLine->getCreateDate()->format('Y-m-d') && $schoolTeacherCallSheetLine->getIsAbsent()) {
  1623.                 $nb++;
  1624.             }
  1625.         }
  1626.         return $nb;
  1627.     }
  1628.     /**
  1629.      * @return Collection|SchoolReportCardAbsence[]
  1630.      */
  1631.     public function getSchoolReportCardAbsences(): Collection
  1632.     {
  1633.         return $this->schoolReportCardAbsences;
  1634.     }
  1635.     public function addSchoolReportCardAbsence(SchoolReportCardAbsence $schoolReportCardAbsence): self
  1636.     {
  1637.         if (!$this->schoolReportCardAbsences->contains($schoolReportCardAbsence)) {
  1638.             $this->schoolReportCardAbsences[] = $schoolReportCardAbsence;
  1639.             $schoolReportCardAbsence->setStudentRegistration($this);
  1640.         }
  1641.         return $this;
  1642.     }
  1643.     public function removeSchoolReportCardAbsence(SchoolReportCardAbsence $schoolReportCardAbsence): self
  1644.     {
  1645.         if ($this->schoolReportCardAbsences->removeElement($schoolReportCardAbsence)) {
  1646.             // set the owning side to null (unless already changed)
  1647.             if ($schoolReportCardAbsence->getStudentRegistration() === $this) {
  1648.                 $schoolReportCardAbsence->setStudentRegistration(null);
  1649.             }
  1650.         }
  1651.         return $this;
  1652.     }
  1653.     /**
  1654.      * @return Collection|WavePayment[]
  1655.      */
  1656.     public function getWavePayments(): Collection
  1657.     {
  1658.         return $this->wavePayments;
  1659.     }
  1660.     public function addWavePayment(WavePayment $wavePayment): self
  1661.     {
  1662.         if (!$this->wavePayments->contains($wavePayment)) {
  1663.             $this->wavePayments[] = $wavePayment;
  1664.             $wavePayment->setStudentRegistration($this);
  1665.         }
  1666.         return $this;
  1667.     }
  1668.     public function removeWavePayment(WavePayment $wavePayment): self
  1669.     {
  1670.         if ($this->wavePayments->removeElement($wavePayment)) {
  1671.             // set the owning side to null (unless already changed)
  1672.             if ($wavePayment->getStudentRegistration() === $this) {
  1673.                 $wavePayment->setStudentRegistration(null);
  1674.             }
  1675.         }
  1676.         return $this;
  1677.     }
  1678.     public function getSchoolAverage(SchoolAverage $schoolAverage){
  1679.         foreach ($this->getSchoolStudentAverages() as $key => $schoolStudentAverage) {
  1680.             if ($schoolStudentAverage->getSchoolAverage() == $schoolAverage) {
  1681.                 return $schoolStudentAverage->getNote();
  1682.             }
  1683.         }
  1684.         return false;
  1685.     }
  1686.    
  1687.     public function getSchoolAverageSub(SchoolAverage $schoolAverageSchoolSubMatter $schoolSubMatter){
  1688.         foreach ($this->getSchoolStudentAverages() as $key => $schoolStudentAverage) {
  1689.             if ($schoolStudentAverage->getSchoolAverage() == $schoolAverage) {
  1690.                 if ($schoolStudentAverage->getSubMatter() == $schoolSubMatter) {
  1691.                     return $schoolStudentAverage->getNote();
  1692.                 }
  1693.             }
  1694.         }
  1695.         return false;
  1696.     }
  1697.     public function getSchoolAverageMaterLabel(SchoolAverage $schoolAverage){
  1698.         foreach ($this->getSchoolStudentAverages() as $key => $schoolStudentAverage) {
  1699.             if ($schoolStudentAverage->getSchoolAverage() == $schoolAverage) {
  1700.                 if ($schoolStudentAverage->getSubMatter()) {
  1701.                     return $schoolStudentAverage->getSubMatter()->getCode();
  1702.                 }
  1703.                 
  1704.             }
  1705.         }
  1706.         return false;
  1707.     }
  1708.     public function getSchoolAverageCoeff(SchoolAverage $schoolAverage){
  1709.         foreach ($this->getSchoolStudentAverages() as $key => $schoolStudentAverage) {
  1710.             if ($schoolStudentAverage->getSchoolAverage() == $schoolAverage) {
  1711.                 return $schoolStudentAverage->getCoefficient();
  1712.             }
  1713.         }
  1714.         return false;
  1715.     }
  1716.     public function getSchoolSubAverageCoeff(SchoolAverage $schoolAverageSchoolSubMatter $schoolSubMatter){
  1717.         foreach ($this->getSchoolStudentAverages() as $key => $schoolStudentAverage) {
  1718.             if ($schoolStudentAverage->getSchoolAverage() == $schoolAverage) {
  1719.                 if ($schoolStudentAverage->getSubMatter() == $schoolSubMatter) {
  1720.                     return $schoolStudentAverage->getCoefficient();
  1721.                 }
  1722.             }
  1723.         }
  1724.         return false;
  1725.     }
  1726.     public function average_report_card(SchoolYearPeriode $schoolYearPeriodeSchoolMatter $schoolMatter){
  1727.         foreach ($this->getSchoolAverageReportCards() as $key => $schoolAverageReportCard) {
  1728.             if ($schoolAverageReportCard->getMatter() == $schoolMatter && $schoolAverageReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  1729.                 return $schoolAverageReportCard;
  1730.             }
  1731.         }
  1732.         return new SchoolAverageReportCard();
  1733.     }
  1734.     public function average_report_card_sub(SchoolYearPeriode $schoolYearPeriodeSchoolSubMatter $schoolSubMatter){
  1735.         foreach ($this->getSchoolAverageReportCards() as $key => $schoolAverageReportCard) {
  1736.             if ($schoolAverageReportCard->getSubMatter() == $schoolSubMatter && $schoolAverageReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  1737.                 return $schoolAverageReportCard;
  1738.             }
  1739.         }
  1740.         return new SchoolAverageReportCard();
  1741.     }
  1742.     public function annual_average_report_card(SchoolMatter $schoolMatter){
  1743.         $averageReportCard = new SchoolAverageReportCard();
  1744.         
  1745.         foreach ($this->getSchoolAverageReportCards() as $key => $schoolAverageReportCard) {
  1746.             if ($schoolAverageReportCard->getMatter() == $schoolMatter) {
  1747.                 $averageReportCard $schoolAverageReportCard;
  1748.             }
  1749.         }
  1750.         return $averageReportCard;
  1751.     }
  1752.     public function annual_average_report_card_sub(SchoolSubMatter $schoolSubMatter){
  1753.         $averageReportCard = new SchoolAverageReportCard();
  1754.         foreach ($this->getSchoolAverageReportCards() as $key => $schoolAverageReportCard) {
  1755.             if ($schoolAverageReportCard->getSubMatter() == $schoolSubMatter) {
  1756.                 $averageReportCard $schoolAverageReportCard;
  1757.             }
  1758.         }
  1759.         return $averageReportCard;
  1760.     }
  1761.     public function last_report_card(){
  1762.         $reportCard = new SchoolReportCard();
  1763.         foreach ($this->getSchoolReportCards() as $key => $schoolReportCard) {
  1764.             //if ($schoolAverageReportCard->getSubMatter() == $schoolSubMatter) {
  1765.                 $reportCard $schoolReportCard;
  1766.             //}
  1767.         }
  1768.         return $reportCard;
  1769.     }
  1770.     public function average_report_card_type(SchoolYearPeriode $schoolYearPeriodeSchoolMatterType $schoolMatterType){
  1771.         $sCoeff 0;
  1772.         $sXCoeff 0;
  1773.         foreach ($this->getSchoolAverageReportCards() as $key => $schoolAverageReportCard) {
  1774.             if ($schoolAverageReportCard->getMatter()->getMatterType() == $schoolMatterType && $schoolAverageReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  1775.                 $sXCoeff += $schoolAverageReportCard->getCoefficientXAverage();
  1776.                 $sCoeff += $schoolAverageReportCard->getCoefficient();
  1777.             }
  1778.         }
  1779.         if ($sCoeff 0) {
  1780.             return ($sXCoeff $sCoeff);
  1781.         }
  1782.         return 0;
  1783.     }
  1784.     public function total_xaverage_report_card(SchoolYearPeriode $schoolYearPeriode){
  1785.         $sXCoeff 0;
  1786.         foreach ($this->getSchoolAverageReportCards() as $key => $schoolAverageReportCard) {
  1787.             if ($schoolAverageReportCard->getSchoolYearPeriode() == $schoolYearPeriode) {
  1788.                 $sXCoeff += $schoolAverageReportCard->getCoefficientXAverage();
  1789.             }
  1790.         }
  1791.         return $sXCoeff;
  1792.     }
  1793.     /**
  1794.      * @return Collection|RegistrationStudentContact[]
  1795.      */
  1796.     public function getRegistrationStudentContacts(): Collection
  1797.     {
  1798.         return $this->registrationStudentContacts;
  1799.     }
  1800.     public function addRegistrationStudentContact(RegistrationStudentContact $registrationStudentContact): self
  1801.     {
  1802.         if (!$this->registrationStudentContacts->contains($registrationStudentContact)) {
  1803.             $this->registrationStudentContacts[] = $registrationStudentContact;
  1804.             $registrationStudentContact->setRegistrationStudentRegistration($this);
  1805.         }
  1806.         return $this;
  1807.     }
  1808.     public function removeRegistrationStudentContact(RegistrationStudentContact $registrationStudentContact): self
  1809.     {
  1810.         if ($this->registrationStudentContacts->removeElement($registrationStudentContact)) {
  1811.             // set the owning side to null (unless already changed)
  1812.             if ($registrationStudentContact->getRegistrationStudentRegistration() === $this) {
  1813.                 $registrationStudentContact->setRegistrationStudentRegistration(null);
  1814.             }
  1815.         }
  1816.         return $this;
  1817.     }
  1818.     /**
  1819.      * @return Collection|TransportCallSheetLine[]
  1820.      */
  1821.     public function getTransportCallSheetLines(): Collection
  1822.     {
  1823.         return $this->transportCallSheetLines;
  1824.     }
  1825.     public function addTransportCallSheetLine(TransportCallSheetLine $transportCallSheetLine): self
  1826.     {
  1827.         if (!$this->transportCallSheetLines->contains($transportCallSheetLine)) {
  1828.             $this->transportCallSheetLines[] = $transportCallSheetLine;
  1829.             $transportCallSheetLine->setRegistrationStudentRegistration($this);
  1830.         }
  1831.         return $this;
  1832.     }
  1833.     public function removeTransportCallSheetLine(TransportCallSheetLine $transportCallSheetLine): self
  1834.     {
  1835.         if ($this->transportCallSheetLines->removeElement($transportCallSheetLine)) {
  1836.             // set the owning side to null (unless already changed)
  1837.             if ($transportCallSheetLine->getRegistrationStudentRegistration() === $this) {
  1838.                 $transportCallSheetLine->setRegistrationStudentRegistration(null);
  1839.             }
  1840.         }
  1841.         return $this;
  1842.     }
  1843.     /**
  1844.      * @return Collection|StockExitSlip[]
  1845.      */
  1846.     public function getStockExitSlips(): Collection
  1847.     {
  1848.         return $this->stockExitSlips;
  1849.     }
  1850.     public function addStockExitSlip(StockExitSlip $stockExitSlip): self
  1851.     {
  1852.         if (!$this->stockExitSlips->contains($stockExitSlip)) {
  1853.             $this->stockExitSlips[] = $stockExitSlip;
  1854.             $stockExitSlip->setRegistrationStudentRegistration($this);
  1855.         }
  1856.         return $this;
  1857.     }
  1858.     public function removeStockExitSlip(StockExitSlip $stockExitSlip): self
  1859.     {
  1860.         if ($this->stockExitSlips->removeElement($stockExitSlip)) {
  1861.             // set the owning side to null (unless already changed)
  1862.             if ($stockExitSlip->getRegistrationStudentRegistration() === $this) {
  1863.                 $stockExitSlip->setRegistrationStudentRegistration(null);
  1864.             }
  1865.         }
  1866.         return $this;
  1867.     }
  1868.     public function getTotalSchooling(){
  1869.         $total 0;
  1870.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  1871.             if ($accountingStudentRegistrationFee->getFee()->getCategory() == 'SCOLARITE') {
  1872.                 $total += $accountingStudentRegistrationFee->getAmount();
  1873.             }
  1874.         }
  1875.         return $total;
  1876.     }
  1877.     public function getSchooling(){
  1878.         $data = new ArrayCollection();
  1879.         foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
  1880.             if ($accountingStudentRegistrationFee->getFee()->getCategory() == 'SCOLARITE') {
  1881.                 $data->add($accountingStudentRegistrationFee);
  1882.             }
  1883.         }
  1884.         return $data;
  1885.     }
  1886.     public function getFirstPayment(){
  1887.         foreach ($this->getAccountingStudentRegistrationPayments() as $key => $accountingStudentRegistrationPayment) {
  1888.             return $accountingStudentRegistrationPayment->getAmount();
  1889.         }
  1890.         return 0;
  1891.     }
  1892. }