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