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