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