src/Entity/Gestiform/Formations/Dossier/Dossier.php line 43

  1. <?php
  2. namespace App\Entity\Gestiform\Formations\Dossier;
  3. use App\Entity\AbstractEntity;
  4. use App\Entity\Common\Adresse;
  5. use App\Entity\Common\Convention;
  6. use App\Entity\Common\Document;
  7. use App\Entity\Common\HistoriqueEmail;
  8. use App\Entity\Common\Upload;
  9. use App\Entity\Gestiform\Admin\Cursus\CursusReponses;
  10. use App\Entity\Gestiform\Admin\Cursus\CVdynamique;
  11. use App\Entity\Gestiform\Admin\Cursus\Entretien;
  12. use App\Entity\Gestiform\Admin\Etablissement;
  13. use App\Entity\Gestiform\Admin\MasterListe\Masterlistelg;
  14. use App\Entity\Gestiform\Admin\Platforme;
  15. use App\Entity\Gestiform\Admin\Profil;
  16. use App\Entity\Gestiform\Admin\Site;
  17. use App\Entity\Gestiform\Admin\Societe;
  18. use App\Entity\Gestiform\Formations\Catalogue\Parcours\Parcours;
  19. use App\Entity\Gestiform\Formations\Devis\Devis;
  20. use App\Entity\Gestiform\Formations\Emargement\EmargementJustificatif;
  21. use App\Entity\Gestiform\Formations\Entreprise\Contact;
  22. use App\Entity\Gestiform\Formations\Entreprise\Entreprise;
  23. use App\Entity\Gestiform\Formations\Facturation\Facturation;
  24. use App\Entity\Gestiform\Formations\Financement\Financement;
  25. use App\Entity\Gestiform\Formations\Reglement\Reglement;
  26. use App\Entity\Gestiform\Formations\Reunion\ReunionDossier;
  27. use App\Entity\Gestiform\Formations\Session\Planning\Planning;
  28. use App\Entity\Gestiform\Formations\Session\Session;
  29. use App\Entity\Gestiform\Quiz\Quiz;
  30. use App\Entity\Gestiform\Quiz\QuizReponse;
  31. use App\Entity\Gestiform\Users\Apprenant;
  32. use App\Entity\Gestiform\Users\Employe;
  33. use App\Entity\Gestiform\Users\HistoriqueChat;
  34. use App\Repository\Gestiform\Formations\Dossier\DossierRepository;
  35. use DateTime;
  36. use Doctrine\Common\Collections\ArrayCollection;
  37. use Doctrine\Common\Collections\Collection;
  38. use Doctrine\ORM\Mapping as ORM;
  39. use JsonException;
  40. #[ORM\Entity(repositoryClassDossierRepository::class)]
  41. class Dossier extends AbstractEntity
  42. {
  43.     #[ORM\Column(type'string'length255nullabletrue)]
  44.     private ?string $reference null;
  45.     #[ORM\Column(type'text'nullabletrue)]
  46.     private ?string $itemsDocument null;
  47.     #[ORM\Column(type'json'nullabletrue)]
  48.     private ?array $emailLogs null;
  49.     #[ORM\Column(type'text'nullabletrue)]
  50.     private ?string $panier null;
  51.     #[ORM\Column(type'text'nullabletrue)]
  52.     private ?string $competences null;
  53.     #[ORM\Column(type'text'nullabletrue)]
  54.     private ?string $cart null;
  55.     #[ORM\Column(type'string'length255nullabletrue)]
  56.     private ?string $mode null;
  57.     #[ORM\Column(type'string'length255nullabletrue)]
  58.     private ?string $linkedin null;
  59.     #[ORM\Column(type'string'length255nullabletrue)]
  60.     private ?string $portfolio null;
  61.     #[ORM\Column(type'string'length255nullabletrue)]
  62.     private ?string $campus null;
  63.     #[ORM\Column(type'string'length255nullabletrue)]
  64.     private ?string $modaliteEnseignement null;
  65.     #[ORM\Column(type'string'length255nullabletrue)]
  66.     private ?string $commentaire null;
  67.     #[ORM\Column(type'string'length255nullabletrue)]
  68.     private ?string $emailCandidature null;
  69.     #[ORM\Column(type'datetime'nullabletrue)]
  70.     private ?DateTime $dateReunion null;
  71.     #[ORM\JoinColumn(nullabletrue)]
  72.     #[ORM\OneToOne(targetEntityUpload::class, cascade: ['persist''remove'])]
  73.     private ?Upload $stopProof null;
  74.     #[ORM\JoinColumn(nullabletrue)]
  75.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  76.     private ?Masterlistelg $stopCause null;
  77.     #[ORM\JoinColumn(nullabletrue)]
  78.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  79.     private ?Masterlistelg $stopType null;
  80.     #[ORM\Column(type'datetime'nullabletrue)]
  81.     private ?DateTime $stopDate null;
  82.     #[ORM\Column(type'boolean'nullabletrue)]
  83.     private ?bool $candidateAvailable false;
  84.     #[ORM\Column(type'boolean'nullabletrue)]
  85.     private ?bool $rncp false;
  86.     #[ORM\Column(type'boolean'nullabletrue)]
  87.     private ?bool $diplomant false;
  88.     #[ORM\Column(type'boolean'nullabletrue)]
  89.     private ?bool $delegueClasse false;
  90.     #[ORM\Column(type'boolean'nullabletrue)]
  91.     private ?bool $postulantAvailable false;
  92.     #[ORM\Column(type'boolean'nullabletrue)]
  93.     private ?bool $prospectAvailable false;
  94.     #[ORM\Column(type'boolean'nullabletrue)]
  95.     private ?bool $stagiaireAvailable false;
  96.     #[ORM\Column(type'boolean'nullabletrue)]
  97.     private ?bool $alumniAvailable false;
  98.     #[ORM\Column(type'boolean'nullabletrue)]
  99.     private ?bool $newsLetter false;
  100.     #[ORM\Column(type'boolean'nullabletrue)]
  101.     private ?bool $processed false;
  102.     #[ORM\Column(type'boolean'nullabletrue)]
  103.     private ?bool $statutDeclaration false;
  104.     #[ORM\Column(type'boolean'nullabletrue)]
  105.     private ?bool $aRepresentantLegal false;
  106.     #[ORM\Column(type'boolean'nullabletrue)]
  107.     private ?bool $notificationPaiement false;
  108.     #[ORM\Column(type'boolean'nullabletrue)]
  109.     private ?bool $engagementFormation false;
  110.     #[ORM\Column(type'boolean'nullabletrue)]
  111.     private ?bool $charteFormation false;
  112.     #[ORM\Column(type'boolean'nullabletrue)]
  113.     private ?bool $compteZoom false;
  114.     #[ORM\Column(type'boolean'nullabletrue)]
  115.     private ?bool $notified false;
  116.     #[ORM\Column(type'boolean'nullabletrue)]
  117.     private ?bool $femmeEloigne false;
  118.     #[ORM\Column(type'boolean'nullabletrue)]
  119.     private ?bool $zrr false;
  120.     #[ORM\Column(type'boolean'nullabletrue)]
  121.     private ?bool $qpv false;
  122.     #[ORM\Column(type'decimal'precision10scale2nullabletrue)]
  123.     private ?string $participationReglee null;
  124.     #[ORM\Column(type'decimal'precision10scale2nullabletrue)]
  125.     private ?string $participation null;
  126.     #[ORM\Column(type'decimal'precision10scale2nullabletrue)]
  127.     private ?string $caution null;
  128.     #[ORM\Column(type'decimal'precision10scale2nullabletrue)]
  129.     private ?string $resteaRegler null;
  130.     #[ORM\JoinColumn(nullabletrue)]
  131.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  132.     private ?Masterlistelg $typeActif null;
  133.     #[ORM\JoinColumn(nullabletrue)]
  134.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  135.     private ?Masterlistelg $state null;
  136.     #[ORM\JoinColumn(nullabletrue)]
  137.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  138.     private ?Masterlistelg $dispositif null;
  139.     #[ORM\JoinColumn(nullabletrue)]
  140.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  141.     private ?Masterlistelg $typeFormation null;
  142.     #[ORM\JoinColumn(nullabletrue)]
  143.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  144.     private ?Masterlistelg $resultat null;
  145.     #[ORM\JoinColumn(nullabletrue)]
  146.     #[ORM\ManyToOne(targetEntityProfil::class, cascade: ['persist'])]
  147.     private ?Profil $profil null;
  148.     #[ORM\JoinColumn(nullabletrue)]
  149.     #[ORM\ManyToOne(targetEntityPersonalInformations::class, cascade: ['persist'])]
  150.     private ?PersonalInformations $personalInformations null;
  151.     #[ORM\JoinColumn(nullabletrue)]
  152.     #[ORM\OneToOne(targetEntityAdresse::class, cascade: ['all'])]
  153.     private ?Adresse $adresse null;
  154.     #[ORM\JoinColumn(nullabletrue)]
  155.     #[ORM\OneToOne(inversedBy'dossier'targetEntityPlanning::class, cascade: ['persist'])]
  156.     private ?Planning $planning null;
  157.     #[ORM\JoinColumn(nullabletrue)]
  158.     #[ORM\ManyToOne(targetEntitySession::class, inversedBy'dossiers')]
  159.     private ?Session $session null;
  160.     #[ORM\JoinColumn(nullabletrue)]
  161.     #[ORM\ManyToOne(targetEntitySociete::class, inversedBy'dossiers')]
  162.     private ?Societe $societe null;
  163.     #[ORM\JoinColumn(nullabletrue)]
  164.     #[ORM\ManyToOne(targetEntitySite::class, inversedBy'dossiers')]
  165.     private ?Site $site null;
  166.     #[ORM\JoinColumn(nullabletrue)]
  167.     #[ORM\OneToOne(targetEntityDossierAnnexes::class, cascade: ['all'])]
  168.     private ?DossierAnnexes $dossierannexes null;
  169.     #[ORM\OneToMany(mappedBy'dossier'targetEntityDocument::class, cascade: ['persist'])]
  170.     private Collection $documents;
  171.     #[ORM\OneToMany(mappedBy'dossier'targetEntityHistoriqueEmail::class, cascade: ['persist'])]
  172.     private Collection $historiqueEmails;
  173.     #[ORM\OneToMany(mappedBy'dossier'targetEntityEmargementJustificatif::class, cascade: ['persist'])]
  174.     private Collection $justificatifs;
  175.     #[ORM\JoinColumn(nullabletrue)]
  176.     #[ORM\ManyToOne(targetEntityApprenant::class, cascade: ['persist'], inversedBy'dossiers')]
  177.     private ?Apprenant $apprenant null;
  178.     #[ORM\JoinColumn(nullabletrue)]
  179.     #[ORM\ManyToOne(targetEntityParcours::class, cascade: ['persist'])]
  180.     private ?Parcours $parcours null;
  181.     #[ORM\OneToMany(mappedBy'dossier'targetEntityCVdynamique::class, cascade: ['persist'])]
  182.     private Collection $cvDynamiques;
  183.     #[ORM\OneToMany(mappedBy'dossier'targetEntityEntretien::class, cascade: ['persist'])]
  184.     private Collection $entretiens;
  185.     #[ORM\OneToMany(mappedBy'dossier'targetEntityCursusReponses::class, cascade: ['persist'])]
  186.     private Collection $reponses;
  187.     #[ORM\OneToMany(mappedBy'dossier'targetEntityQuizReponse::class, cascade: ['persist'])]
  188.     private Collection $formulaireReponses;
  189.     #[ORM\OneToMany(mappedBy'dossier'targetEntityReunionDossier::class)]
  190.     private Collection $reunionDossiers;
  191.     #[ORM\OneToMany(mappedBy'dossier'targetEntityHistoriqueDossier::class, cascade: ['persist'])]
  192.     private Collection $historiqueDossiers;
  193.     #[ORM\OneToMany(mappedBy'dossier'targetEntityReglement::class, cascade: ['persist''remove'], orphanRemovaltrue)]
  194.     private Collection $reglements;
  195.     #[ORM\JoinColumn(nullabletrue)]
  196.     #[ORM\ManyToOne(targetEntityEmploye::class, inversedBy'dossierReorienters')]
  197.     private ?Employe $reorienter null;
  198.     #[ORM\JoinColumn(nullabletrue)]
  199.     #[ORM\ManyToOne(targetEntityEmploye::class, inversedBy'referentPedagogiques')]
  200.     private ?Employe $referentPedagogique null;
  201.     #[ORM\JoinColumn(nullabletrue)]
  202.     #[ORM\ManyToOne(targetEntityEmploye::class, inversedBy'referentCommercials')]
  203.     private ?Employe $referentCommercial null;
  204.     #[ORM\JoinColumn(nullabletrue)]
  205.     #[ORM\ManyToOne(targetEntityEmploye::class, inversedBy'referentCoachs')]
  206.     private ?Employe $referentCoach null;
  207.     #[ORM\JoinColumn(nullabletrue)]
  208.     #[ORM\ManyToOne(targetEntityEmploye::class, inversedBy'referentAdministratifs')]
  209.     private ?Employe $referentAdministratif null;
  210.     #[ORM\OneToMany(mappedBy'dossier'targetEntityConvention::class, cascade: ['persist'])]
  211.     private Collection $conventions;
  212.     #[ORM\OneToMany(mappedBy'dossier'targetEntityDevis::class, cascade: ['persist'])]
  213.     private Collection $deviss;
  214.     #[ORM\ManyToMany(targetEntityDevis::class, inversedBy'dossiers')]
  215.     private Collection $devisEntreprises;
  216.     #[ORM\ManyToOne(targetEntityEntreprise::class, inversedBy'dossiers')]
  217.     private ?Entreprise $entreprise null;
  218.     #[ORM\ManyToOne(targetEntityContact::class, inversedBy'dossiers')]
  219.     private ?Contact $entrepriseContact null;
  220.     #[ORM\JoinColumn(nullabletrue)]
  221.     #[ORM\OneToOne(targetEntityUpload::class, cascade: ['persist''remove'])]
  222.     private ?Upload $cv null;
  223.     #[ORM\OneToMany(mappedBy'dossier'targetEntityFinancement::class, cascade: ['persist'])]
  224.     private Collection $financements;
  225.     #[ORM\JoinColumn(nullabletrue)]
  226.     #[ORM\ManyToOne(targetEntityPlatforme::class, inversedBy'dossiers')]
  227.     private ?Platforme $platforme null;
  228.     #[ORM\OneToMany(mappedBy'dossier'targetEntityDossierQuiz::class, cascade: ['all'])]
  229.     private Collection $dossierQuizzs;
  230.     #[ORM\OneToMany(mappedBy'dossier'targetEntityHistoriqueComment::class, cascade: ['all'])]
  231.     private Collection $historiqueComments;
  232.     #[ORM\OneToMany(mappedBy'dossier'targetEntityHistoriqueChat::class, cascade: ['persist'])]
  233.     private Collection $historiqueChats;
  234.     #[ORM\OneToOne(mappedBy'dossier'targetEntityDiplome::class, cascade: ['persist'])]
  235.     private ?Diplome $diplome null;
  236.     #[ORM\OneToMany(mappedBy'dossier'targetEntityAvertissement::class, cascade: ['persist'])]
  237.     private Collection $avertissements;
  238.     #[ORM\JoinColumn(nullabletrue)]
  239.     #[ORM\ManyToOne(targetEntityContact::class, cascade: ['all'])]
  240.     private ?Contact $emergencyContact null;
  241.     #[ORM\JoinColumn(nullabletrue)]
  242.     #[ORM\ManyToOne(targetEntityContact::class, cascade: ['all'])]
  243.     private ?Contact $legalRepresentative null;
  244.     #[ORM\JoinColumn(nullabletrue)]
  245.     #[ORM\ManyToOne(targetEntityEtablissement::class, cascade: ['all'])]
  246.     private ?Etablissement $etablissement null;
  247.     #[ORM\OneToMany(mappedBy'dossier'targetEntityFacturation::class, cascade: ['persist'])]
  248.     private Collection $facturations;
  249.     public function __construct()
  250.     {
  251.         $this->documents = new ArrayCollection();
  252.         $this->historiqueEmails = new ArrayCollection();
  253.         $this->cvDynamiques = new ArrayCollection();
  254.         $this->entretiens = new ArrayCollection();
  255.         $this->reponses = new ArrayCollection();
  256.         $this->reglements = new ArrayCollection();
  257.         $this->historiqueDossiers = new ArrayCollection();
  258.         $this->conventions = new ArrayCollection();
  259.         $this->deviss = new ArrayCollection();
  260.         $this->devisEntreprises = new ArrayCollection();
  261.         $this->financements = new ArrayCollection();
  262.         $this->reunionDossiers = new ArrayCollection();
  263.         $this->dossierQuizzs = new ArrayCollection();
  264.         $this->historiqueComments = new ArrayCollection();
  265.         $this->historiqueChats = new ArrayCollection();
  266.         $this->justificatifs = new ArrayCollection();
  267.         $this->avertissements = new ArrayCollection();
  268.         $this->facturations = new ArrayCollection();
  269.         $this->formulaireReponses = new ArrayCollection();
  270.         $this->emailLogs = [];
  271.     }
  272.     public function getReference(): ?string
  273.     {
  274.         return $this->reference;
  275.     }
  276.     public function setReference(?string $reference): self
  277.     {
  278.         $this->reference $reference;
  279.         return $this;
  280.     }
  281.     public function getPlanningOrSessionPlanning(): ?Planning
  282.     {
  283.         return $this->planning ?? $this->getSession()?->getPlanning();
  284.     }
  285.     public function getPlanning(): ?Planning
  286.     {
  287.         return $this->planning;
  288.     }
  289.     public function setPlanning(?Planning $planning): self
  290.     {
  291.         $this->planning $planning;
  292.         return $this;
  293.     }
  294.     public function getSession(): ?Session
  295.     {
  296.         return $this->session;
  297.     }
  298.     public function setSession(?Session $session): self
  299.     {
  300.         $this->session $session;
  301.         return $this;
  302.     }
  303.     public function getCommentaire(): ?string
  304.     {
  305.         return $this->commentaire;
  306.     }
  307.     public function setCommentaire(?string $commentaire): self
  308.     {
  309.         $this->commentaire $commentaire;
  310.         return $this;
  311.     }
  312.     public function getMode(): ?string
  313.     {
  314.         return $this->mode;
  315.     }
  316.     public function setMode(?string $mode): self
  317.     {
  318.         $this->mode $mode;
  319.         return $this;
  320.     }
  321.     public function getCampus(): ?string
  322.     {
  323.         return $this->campus;
  324.     }
  325.     public function setCampus(?string $campus): self
  326.     {
  327.         $this->campus $campus;
  328.         return $this;
  329.     }
  330.     public function getDateReunion(): ?DateTime
  331.     {
  332.         return $this->dateReunion;
  333.     }
  334.     public function setDateReunion(?DateTime $dateReunion): self
  335.     {
  336.         $this->dateReunion $dateReunion;
  337.         return $this;
  338.     }
  339.     public function getEmailCandidature(): ?string
  340.     {
  341.         return $this->emailCandidature;
  342.     }
  343.     public function setEmailCandidature(?string $emailCandidature): self
  344.     {
  345.         $this->emailCandidature $emailCandidature;
  346.         return $this;
  347.     }
  348.     public function isNewsLetter(): ?bool
  349.     {
  350.         return $this->newsLetter;
  351.     }
  352.     public function setNewsLetter(?bool $newsLetter): self
  353.     {
  354.         $this->newsLetter $newsLetter;
  355.         return $this;
  356.     }
  357.     public function isProcessed(): ?bool
  358.     {
  359.         return $this->processed;
  360.     }
  361.     public function setProcessed(?bool $processed): self
  362.     {
  363.         $this->processed $processed;
  364.         return $this;
  365.     }
  366.     public function getTypeActif(): ?Masterlistelg
  367.     {
  368.         return $this->typeActif;
  369.     }
  370.     public function setTypeActif(?Masterlistelg $typeActif): self
  371.     {
  372.         $this->typeActif $typeActif;
  373.         return $this;
  374.     }
  375.     public function getState(): ?Masterlistelg
  376.     {
  377.         return $this->state;
  378.     }
  379.     public function setState(?Masterlistelg $state): self
  380.     {
  381.         $this->state $state;
  382.         return $this;
  383.     }
  384.     public function getDispositif(): ?Masterlistelg
  385.     {
  386.         return $this->dispositif;
  387.     }
  388.     public function setDispositif(?Masterlistelg $dispositif): self
  389.     {
  390.         $this->dispositif $dispositif;
  391.         return $this;
  392.     }
  393.     public function getProfil(): ?Profil
  394.     {
  395.         return $this->profil;
  396.     }
  397.     public function setProfil(?Profil $profil): self
  398.     {
  399.         $this->profil $profil;
  400.         return $this;
  401.     }
  402.     public function getPersonalInformations(): ?PersonalInformations
  403.     {
  404.         return $this->personalInformations;
  405.     }
  406.     public function setPersonalInformations(?PersonalInformations $personalInformations): self
  407.     {
  408.         $this->personalInformations $personalInformations;
  409.         return $this;
  410.     }
  411.     public function getAdresse(): ?Adresse
  412.     {
  413.         return $this->adresse;
  414.     }
  415.     public function setAdresse(?Adresse $adresse): self
  416.     {
  417.         $this->adresse $adresse;
  418.         return $this;
  419.     }
  420.     public function getDossierannexes(): ?DossierAnnexes
  421.     {
  422.         return $this->dossierannexes;
  423.     }
  424.     public function setDossierannexes(?DossierAnnexes $dossierannexes): self
  425.     {
  426.         $this->dossierannexes $dossierannexes;
  427.         return $this;
  428.     }
  429.     public function getTypeFormation(): ?Masterlistelg
  430.     {
  431.         return $this->typeFormation;
  432.     }
  433.     public function setTypeFormation(?Masterlistelg $typeFormation): self
  434.     {
  435.         $this->typeFormation $typeFormation;
  436.         return $this;
  437.     }
  438.     /**
  439.      * @return Collection<int, Document>
  440.      */
  441.     public function getDocuments(): Collection
  442.     {
  443.         return $this->documents;
  444.     }
  445.     public function addDocument(Document $document): self
  446.     {
  447.         if (!$this->documents->contains($document)) {
  448.             $this->documents->add($document);
  449.             $document->setDossier($this);
  450.         }
  451.         return $this;
  452.     }
  453.     public function removeDocument(Document $document): self
  454.     {
  455.         // set the owning side to null (unless already changed)
  456.         if ($this->documents->removeElement($document) && $document->getDossier() === $this) {
  457.             $document->setDossier(null);
  458.         }
  459.         return $this;
  460.     }
  461.     /**
  462.      * @return Collection<int, HistoriqueEmail>
  463.      */
  464.     public function getHistoriqueEmails(): Collection
  465.     {
  466.         return $this->historiqueEmails;
  467.     }
  468.     public function addHistoriqueEmail(HistoriqueEmail $historiqueEmail): self
  469.     {
  470.         if (!$this->historiqueEmails->contains($historiqueEmail)) {
  471.             $this->historiqueEmails->add($historiqueEmail);
  472.             $historiqueEmail->setDossier($this);
  473.         }
  474.         return $this;
  475.     }
  476.     public function removeHistoriqueEmail(HistoriqueEmail $historiqueEmail): self
  477.     {
  478.         // set the owning side to null (unless already changed)
  479.         if ($this->historiqueEmails->removeElement($historiqueEmail) && $historiqueEmail->getDossier() === $this) {
  480.             $historiqueEmail->setDossier(null);
  481.         }
  482.         return $this;
  483.     }
  484.     public function getApprenant(): ?Apprenant
  485.     {
  486.         return $this->apprenant;
  487.     }
  488.     public function setApprenant(?Apprenant $apprenant): self
  489.     {
  490.         $this->apprenant $apprenant;
  491.         return $this;
  492.     }
  493.     public function getParcours(): ?Parcours
  494.     {
  495.         return $this->parcours;
  496.     }
  497.     public function setParcours(?Parcours $parcours): self
  498.     {
  499.         $this->parcours $parcours;
  500.         return $this;
  501.     }
  502.     /**
  503.      * @return Collection<int, CVdynamique>
  504.      */
  505.     public function getCVDynamiques(): Collection
  506.     {
  507.         return $this->cvDynamiques;
  508.     }
  509.     public function addCVDynamique(CVdynamique $cvDynamique): self
  510.     {
  511.         if (!$this->cvDynamiques->contains($cvDynamique)) {
  512.             $this->cvDynamiques->add($cvDynamique);
  513.             $cvDynamique->setDossier($this);
  514.         }
  515.         return $this;
  516.     }
  517.     public function removeCVDynamique(CVdynamique $cVDynamique): self
  518.     {
  519.         // set the owning side to null (unless already changed)
  520.         if ($this->cvDynamiques->removeElement($cVDynamique) && $cVDynamique->getDossier() === $this) {
  521.             $cVDynamique->setDossier(null);
  522.         }
  523.         return $this;
  524.     }
  525.     public function addEntretien(Entretien $entretien): self
  526.     {
  527.         if (!$this->entretiens->contains($entretien)) {
  528.             $this->entretiens->add($entretien);
  529.             $entretien->setDossier($this);
  530.         }
  531.         return $this;
  532.     }
  533.     public function removeEntretien(Entretien $entretien): self
  534.     {
  535.         // set the owning side to null (unless already changed)
  536.         if ($this->entretiens->removeElement($entretien) && $entretien->getDossier() === $this) {
  537.             $entretien->setDossier(null);
  538.         }
  539.         return $this;
  540.     }
  541.     /**
  542.      * @return Collection<int, CursusReponses>
  543.      */
  544.     public function getCursusReponses(): Collection
  545.     {
  546.         return $this->reponses;
  547.     }
  548.     public function addCursusReponse(CursusReponses $reponse): self
  549.     {
  550.         if (!$this->reponses->contains($reponse)) {
  551.             $this->reponses->add($reponse);
  552.             $reponse->setDossier($this);
  553.         }
  554.         return $this;
  555.     }
  556.     public function removeCursusReponse(CursusReponses $reponse): self
  557.     {
  558.         // set the owning side to null (unless already changed)
  559.         if ($this->reponses->removeElement($reponse) && $reponse->getDossier() === $this) {
  560.             $reponse->setDossier(null);
  561.         }
  562.         return $this;
  563.     }
  564.     /**
  565.      * @return Collection<int, HistoriqueDossier>
  566.      */
  567.     public function getHistoriqueDossiers(): Collection
  568.     {
  569.         return $this->historiqueDossiers;
  570.     }
  571.     public function addHistoriqueDossier(HistoriqueDossier $historiqueDossier): self
  572.     {
  573.         if (!$this->historiqueDossiers->contains($historiqueDossier)) {
  574.             $this->historiqueDossiers->add($historiqueDossier);
  575.             $historiqueDossier->setDossier($this);
  576.         }
  577.         return $this;
  578.     }
  579.     public function removeHistoriqueDossier(HistoriqueDossier $historiqueDossier): self
  580.     {
  581.         // set the owning side to null (unless already changed)
  582.         if ($this->historiqueDossiers->removeElement($historiqueDossier) && $historiqueDossier->getDossier() === $this) {
  583.             $historiqueDossier->setDossier(null);
  584.         }
  585.         return $this;
  586.     }
  587.     public function getReorienter(): ?Employe
  588.     {
  589.         return $this->reorienter;
  590.     }
  591.     public function setReorienter(?Employe $reorienter): self
  592.     {
  593.         $this->reorienter $reorienter;
  594.         return $this;
  595.     }
  596.     /**
  597.      * @return Collection<int, Reglement>
  598.      */
  599.     public function getReglements(): Collection
  600.     {
  601.         return $this->reglements;
  602.     }
  603.     public function addReglement(Reglement $reglement): self
  604.     {
  605.         if (!$this->reglements->contains($reglement)) {
  606.             $this->reglements->add($reglement);
  607.             $reglement->setDossier($this);
  608.         }
  609.         return $this;
  610.     }
  611.     public function removeReglement(Reglement $reglement): self
  612.     {
  613.         // set the owning side to null (unless already changed)
  614.         if ($this->reglements->removeElement($reglement) && $reglement->getDossier() === $this) {
  615.             $reglement->setDossier(null);
  616.         }
  617.         return $this;
  618.     }
  619.     public function getParticipationReglee(): ?string
  620.     {
  621.         return $this->participationReglee;
  622.     }
  623.     public function setParticipationReglee(?string $participationReglee): self
  624.     {
  625.         $this->participationReglee $participationReglee;
  626.         return $this;
  627.     }
  628.     public function getParticipation(): ?string
  629.     {
  630.         return $this->participation;
  631.     }
  632.     public function setParticipation(?string $participation): self
  633.     {
  634.         $this->participation $participation;
  635.         return $this;
  636.     }
  637.     public function getCaution(): ?string
  638.     {
  639.         return $this->caution;
  640.     }
  641.     public function setCaution(?string $caution): self
  642.     {
  643.         $this->caution $caution;
  644.         return $this;
  645.     }
  646.     public function getResteaRegler(): ?string
  647.     {
  648.         return $this->resteaRegler;
  649.     }
  650.     public function setResteaRegler(?string $resteaRegler): self
  651.     {
  652.         $this->resteaRegler $resteaRegler;
  653.         return $this;
  654.     }
  655.     /**
  656.      * @return Collection<int, CursusReponses>
  657.      */
  658.     public function getReponses(): Collection
  659.     {
  660.         return $this->reponses;
  661.     }
  662.     public function addReponse(CursusReponses $reponse): self
  663.     {
  664.         if (!$this->reponses->contains($reponse)) {
  665.             $this->reponses->add($reponse);
  666.             $reponse->setDossier($this);
  667.         }
  668.         return $this;
  669.     }
  670.     public function removeReponse(CursusReponses $reponse): self
  671.     {
  672.         // set the owning side to null (unless already changed)
  673.         if ($this->reponses->removeElement($reponse) && $reponse->getDossier() === $this) {
  674.             $reponse->setDossier(null);
  675.         }
  676.         return $this;
  677.     }
  678.     public function getReferentPedagogique(): ?Employe
  679.     {
  680.         return $this->referentPedagogique;
  681.     }
  682.     public function setReferentPedagogique(?Employe $referentPedagogique): self
  683.     {
  684.         $this->referentPedagogique $referentPedagogique;
  685.         return $this;
  686.     }
  687.     public function getReferentCommercial(): ?Employe
  688.     {
  689.         return $this->referentCommercial;
  690.     }
  691.     public function setReferentCommercial(?Employe $referentCommercial): self
  692.     {
  693.         $this->referentCommercial $referentCommercial;
  694.         return $this;
  695.     }
  696.     public function getReferentCoach(): ?Employe
  697.     {
  698.         return $this->referentCoach;
  699.     }
  700.     public function setReferentCoach(?Employe $referentCoach): self
  701.     {
  702.         $this->referentCoach $referentCoach;
  703.         return $this;
  704.     }
  705.     public function getReferentAdministratif(): ?Employe
  706.     {
  707.         return $this->referentAdministratif;
  708.     }
  709.     public function setReferentAdministratif(?Employe $referentAdministratif): self
  710.     {
  711.         $this->referentAdministratif $referentAdministratif;
  712.         return $this;
  713.     }
  714.     /**
  715.      * @return Collection<int, Convention>
  716.      */
  717.     public function getConventions(): Collection
  718.     {
  719.         return $this->conventions;
  720.     }
  721.     public function addConvention(Convention $convention): self
  722.     {
  723.         if (!$this->conventions->contains($convention)) {
  724.             $this->conventions->add($convention);
  725.             $convention->setDossier($this);
  726.         }
  727.         return $this;
  728.     }
  729.     public function removeConvention(Convention $convention): self
  730.     {
  731.         // set the owning side to null (unless already changed)
  732.         if ($this->conventions->removeElement($convention) && $convention->getDossier() === $this) {
  733.             $convention->setDossier(null);
  734.         }
  735.         return $this;
  736.     }
  737.     public function getConvention($type): ?Convention
  738.     {
  739.         foreach ($this->conventions as $convention) {
  740.             if (
  741.                 ($convention->getState()?->getCode() === 'terminee' ||
  742.                     $convention->getState()?->getCode() === 'validee')
  743.                 && $convention->getType()?->getCode() === $type
  744.             ) {
  745.                 return $convention;
  746.             }
  747.         }
  748.         return null;
  749.     }
  750.     public function addDeviss(Devis $deviss): self
  751.     {
  752.         if (!$this->deviss->contains($deviss)) {
  753.             $this->deviss->add($deviss);
  754.             $deviss->setDossier($this);
  755.         }
  756.         return $this;
  757.     }
  758.     public function removeDeviss(Devis $deviss): self
  759.     {
  760.         // set the owning side to null (unless already changed)
  761.         if ($this->deviss->removeElement($deviss) && $deviss->getDossier() === $this) {
  762.             $deviss->setDossier(null);
  763.         }
  764.         return $this;
  765.     }
  766.     public function addDevisEntreprise(Devis $devisEntreprise): self
  767.     {
  768.         if (!$this->devisEntreprises->contains($devisEntreprise)) {
  769.             $this->devisEntreprises->add($devisEntreprise);
  770.         }
  771.         return $this;
  772.     }
  773.     public function removeDevisEntreprise(Devis $devisEntreprise): self
  774.     {
  775.         $this->devisEntreprises->removeElement($devisEntreprise);
  776.         return $this;
  777.     }
  778.     public function getEntreprise(): ?Entreprise
  779.     {
  780.         return $this->entreprise;
  781.     }
  782.     public function setEntreprise(?Entreprise $entreprise): self
  783.     {
  784.         $this->entreprise $entreprise;
  785.         return $this;
  786.     }
  787.     public function isCompteZoom(): ?bool
  788.     {
  789.         return $this->compteZoom;
  790.     }
  791.     public function setCompteZoom(?bool $compteZoom): self
  792.     {
  793.         $this->compteZoom $compteZoom;
  794.         return $this;
  795.     }
  796.     public function getCv(): ?Upload
  797.     {
  798.         return $this->cv;
  799.     }
  800.     public function setCv(?Upload $cv): self
  801.     {
  802.         $this->cv $cv;
  803.         return $this;
  804.     }
  805.     public function addFinancement(Financement $financement): self
  806.     {
  807.         if (!$this->financements->contains($financement)) {
  808.             $this->financements->add($financement);
  809.             $financement->setDossier($this);
  810.         }
  811.         return $this;
  812.     }
  813.     public function removeFinancement(Financement $financement): self
  814.     {
  815.         // set the owning side to null (unless already changed)
  816.         if ($this->financements->removeElement($financement) && $financement->getDossier() === $this) {
  817.             $financement->setDossier(null);
  818.         }
  819.         return $this;
  820.     }
  821.     public function getDetailFinancement(): array
  822.     {
  823.         $resultat = [];
  824.         $resultat['nbfinancements'] = 0;
  825.         $resultat['montantht'] = 0;
  826.         $resultat['montanttva'] = 0;
  827.         $resultat['montantttc'] = 0;
  828.         foreach ($this->getFinancements() as $ligne) {
  829.             $resultat['montantht'] += $ligne->getMontantHt();
  830.             $resultat['montanttva'] += $ligne->getMontantTva();
  831.             $resultat['montantttc'] += $ligne->getMontantTtc();
  832.             ++$resultat['nbfinancements'];
  833.         }
  834.         return $resultat;
  835.     }
  836.     /**
  837.      * @return Collection<int, Financement>
  838.      */
  839.     public function getFinancements(): Collection
  840.     {
  841.         return $this->financements;
  842.     }
  843.     public function getAllFrais(): float
  844.     {
  845.         $resultat 0;
  846.         if (!is_null($this->getDevisActif())) {
  847.             foreach ($this->getDevisActif()?->getDevisLignes() as $ligne) {
  848.                 if (!$ligne->isChargeHT()) {
  849.                     $resultat += $ligne->getMontantHT();
  850.                 }
  851.             }
  852.         }
  853.         return $resultat;
  854.     }
  855.     public function getDevisActif(): Devis|null
  856.     {
  857.         $devis null;
  858.         foreach ($this->getDeviss() as $l) {
  859.             if (!is_null($l->getState()) && $l->getState()?->getCode() === 'accord') {
  860.                 $devis $l;
  861.             }
  862.         }
  863.         if (!is_null($this->getDevisEntreprises())) {
  864.             foreach ($this->getDevisEntreprises() as $l2) {
  865.                 if (!is_null($l2->getState()) && $l2->getState()?->getCode() === 'accord') {
  866.                     $devis $l2;
  867.                 }
  868.             }
  869.         }
  870.         return $devis;
  871.     }
  872.     /**
  873.      * @return Collection<int, Devis>
  874.      */
  875.     public function getDeviss(): Collection
  876.     {
  877.         return $this->deviss;
  878.     }
  879.     /**
  880.      * @return Collection<int, Devis>
  881.      */
  882.     public function getDevisEntreprises(): Collection
  883.     {
  884.         return $this->devisEntreprises;
  885.     }
  886.     public function isNotificationPaiement(): ?bool
  887.     {
  888.         return $this->notificationPaiement;
  889.     }
  890.     public function setNotificationPaiement(?bool $notificationPaiement): self
  891.     {
  892.         $this->notificationPaiement $notificationPaiement;
  893.         return $this;
  894.     }
  895.     public function getPlatforme(): ?Platforme
  896.     {
  897.         return $this->platforme;
  898.     }
  899.     public function setPlatforme(?Platforme $platforme): self
  900.     {
  901.         $this->platforme $platforme;
  902.         return $this;
  903.     }
  904.     public function getEntretienActif()
  905.     {
  906.         if ($this->getEntretiens()->first()) {
  907.             return $this->getEntretiens()->first();
  908.         }
  909.         return null;
  910.     }
  911.     /**
  912.      * @return Collection<int, Entretien>
  913.      */
  914.     public function getEntretiens(): Collection
  915.     {
  916.         return $this->entretiens;
  917.     }
  918.     /**
  919.      * @return Collection<int, ReunionDossier>
  920.      */
  921.     public function getReunionDossiers(): Collection
  922.     {
  923.         return $this->reunionDossiers;
  924.     }
  925.     public function addReunionDossier(ReunionDossier $reunionDossier): self
  926.     {
  927.         if (!$this->reunionDossiers->contains($reunionDossier)) {
  928.             $this->reunionDossiers->add($reunionDossier);
  929.             $reunionDossier->setDossier($this);
  930.         }
  931.         return $this;
  932.     }
  933.     public function removeReunionDossier(ReunionDossier $reunionDossier): self
  934.     {
  935.         // set the owning side to null (unless already changed)
  936.         if ($this->reunionDossiers->removeElement($reunionDossier) && $reunionDossier->getDossier() === $this) {
  937.             $reunionDossier->setDossier(null);
  938.         }
  939.         return $this;
  940.     }
  941.     public function isCandidateAvailable(): ?bool
  942.     {
  943.         return $this->candidateAvailable;
  944.     }
  945.     public function setCandidateAvailable(?bool $candidateAvailable): self
  946.     {
  947.         $this->candidateAvailable $candidateAvailable;
  948.         return $this;
  949.     }
  950.     public function isPostulantAvailable(): ?bool
  951.     {
  952.         return $this->postulantAvailable;
  953.     }
  954.     public function setPostulantAvailable(?bool $postulantAvailable): self
  955.     {
  956.         $this->postulantAvailable $postulantAvailable;
  957.         return $this;
  958.     }
  959.     public function isProspectAvailable(): ?bool
  960.     {
  961.         return $this->prospectAvailable;
  962.     }
  963.     public function setProspectAvailable(?bool $prospectAvailable): self
  964.     {
  965.         $this->prospectAvailable $prospectAvailable;
  966.         return $this;
  967.     }
  968.     public function isStagiaireAvailable(): ?bool
  969.     {
  970.         return $this->stagiaireAvailable;
  971.     }
  972.     public function setStagiaireAvailable(?bool $stagiaireAvailable): self
  973.     {
  974.         $this->stagiaireAvailable $stagiaireAvailable;
  975.         return $this;
  976.     }
  977.     public function isAlumniAvailable(): ?bool
  978.     {
  979.         return $this->alumniAvailable;
  980.     }
  981.     public function setAlumniAvailable(?bool $alumniAvailable): self
  982.     {
  983.         $this->alumniAvailable $alumniAvailable;
  984.         return $this;
  985.     }
  986.     /**
  987.      * @throws JsonException
  988.      */
  989.     public function addItemsDocument(string $intitulestring $urltemplate$type): self
  990.     {
  991.         $exit false;
  992.         $items $this->getItemsDocument();
  993.         foreach ($items as $item) {
  994.             if ($item['intitule'] === $intitule) {
  995.                 $exit true;
  996.             }
  997.         }
  998.         if (!$exit) {
  999.             $items[] = [
  1000.                 'intitule' => $intitule,
  1001.                 'urltemplate' => $urltemplate,
  1002.                 'type' => $type
  1003.             ];
  1004.         }
  1005.         $this->itemsDocument json_encode($itemsJSON_THROW_ON_ERROR);
  1006.         return $this;
  1007.     }
  1008.     /**
  1009.      * @throws JsonException
  1010.      */
  1011.     public function getItemsDocument()
  1012.     {
  1013.         if ($this->itemsDocument === null) {
  1014.             return [];
  1015.         }
  1016.         return json_decode($this->itemsDocumenttrue512JSON_THROW_ON_ERROR);
  1017.     }
  1018.     public function setItemsDocument(?string $itemsDocument): self
  1019.     {
  1020.         $this->itemsDocument $itemsDocument;
  1021.         return $this;
  1022.     }
  1023.     /**
  1024.      * @throws JsonException
  1025.      */
  1026.     public function removeItemDocument(int $templateId): self
  1027.     {
  1028.         $items $this->getItemsDocument();
  1029.         if (array_key_exists($templateId$items)) {
  1030.             unset($items[$templateId]);
  1031.         }
  1032.         $this->itemsDocument json_encode($itemsJSON_THROW_ON_ERROR);
  1033.         return $this;
  1034.     }
  1035.     public function removeItemsDocument(): self
  1036.     {
  1037.         $this->itemsDocument NULL;
  1038.         return $this;
  1039.     }
  1040.     public function isEngagementFormation(): ?bool
  1041.     {
  1042.         return $this->engagementFormation;
  1043.     }
  1044.     public function setEngagementFormation(?bool $engagementFormation): self
  1045.     {
  1046.         $this->engagementFormation $engagementFormation;
  1047.         return $this;
  1048.     }
  1049.     public function isCharteFormation(): ?bool
  1050.     {
  1051.         return $this->charteFormation;
  1052.     }
  1053.     public function setCharteFormation(?bool $charteFormation): self
  1054.     {
  1055.         $this->charteFormation $charteFormation;
  1056.         return $this;
  1057.     }
  1058.     public function getSociete(): ?Societe
  1059.     {
  1060.         return $this->societe;
  1061.     }
  1062.     public function setSociete(?Societe $societe): self
  1063.     {
  1064.         $this->societe $societe;
  1065.         return $this;
  1066.     }
  1067.     public function getSite(): ?Site
  1068.     {
  1069.         return $this->site;
  1070.     }
  1071.     public function setSite(?Site $site): self
  1072.     {
  1073.         $this->site $site;
  1074.         return $this;
  1075.     }
  1076.     /**
  1077.      * @return Collection<int, DossierQuiz>
  1078.      */
  1079.     public function getDossierQuizzs(): Collection
  1080.     {
  1081.         return $this->dossierQuizzs;
  1082.     }
  1083.     public function setDossierQuizzes(Collection $quizzes): self
  1084.     {
  1085.         $this->dossierQuizzs $quizzes;
  1086.         return $this;
  1087.     }
  1088.     public function addDossierQuizz(DossierQuiz $dossierQuizz): self
  1089.     {
  1090.         if (!$this->dossierQuizzs->contains($dossierQuizz)) {
  1091.             $this->dossierQuizzs->add($dossierQuizz);
  1092.             $dossierQuizz->setDossier($this);
  1093.         }
  1094.         return $this;
  1095.     }
  1096.     public function removeDossierQuizz(DossierQuiz $dossierQuizz): self
  1097.     {
  1098.         // set the owning side to null (unless already changed)
  1099.         if ($this->dossierQuizzs->removeElement($dossierQuizz) && $dossierQuizz->getDossier() === $this) {
  1100.             $dossierQuizz->setDossier(null);
  1101.         }
  1102.         return $this;
  1103.     }
  1104.     /**
  1105.      * @return Collection<int, HistoriqueComment>
  1106.      */
  1107.     public function getHistoriqueComments(): Collection
  1108.     {
  1109.         return $this->historiqueComments;
  1110.     }
  1111.     public function addHistoriqueComment(HistoriqueComment $historiqueComment): self
  1112.     {
  1113.         if (!$this->historiqueComments->contains($historiqueComment)) {
  1114.             $this->historiqueComments->add($historiqueComment);
  1115.             $historiqueComment->setDossier($this);
  1116.         }
  1117.         return $this;
  1118.     }
  1119.     public function removeHistoriqueComment(HistoriqueComment $historiqueComment): self
  1120.     {
  1121.         // set the owning side to null (unless already changed)
  1122.         if ($this->historiqueComments->removeElement($historiqueComment) && $historiqueComment->getDossier() === $this) {
  1123.             $historiqueComment->setDossier(null);
  1124.         }
  1125.         return $this;
  1126.     }
  1127.     /**
  1128.      * @return Collection<int, HistoriqueChat>
  1129.      */
  1130.     public function getHistoriqueChats(): Collection
  1131.     {
  1132.         return $this->historiqueChats;
  1133.     }
  1134.     public function addHistoriqueChat(HistoriqueChat $historiqueChat): self
  1135.     {
  1136.         if (!$this->historiqueChats->contains($historiqueChat)) {
  1137.             $this->historiqueChats->add($historiqueChat);
  1138.             $historiqueChat->setDossier($this);
  1139.         }
  1140.         return $this;
  1141.     }
  1142.     public function removeHistoriqueChat(HistoriqueChat $historiqueChat): self
  1143.     {
  1144.         // set the owning side to null (unless already changed)
  1145.         if ($this->historiqueChats->removeElement($historiqueChat) && $historiqueChat->getDossier() === $this) {
  1146.             $historiqueChat->setDossier(null);
  1147.         }
  1148.         return $this;
  1149.     }
  1150.     public function isNotified(): ?bool
  1151.     {
  1152.         return $this->notified;
  1153.     }
  1154.     public function setNotified(?bool $notified): self
  1155.     {
  1156.         $this->notified $notified;
  1157.         return $this;
  1158.     }
  1159.     /**
  1160.      * @return Collection<int, EmargementJustificatif>
  1161.      */
  1162.     public function getJustificatifs(): Collection
  1163.     {
  1164.         return $this->justificatifs;
  1165.     }
  1166.     public function addJustificatif(EmargementJustificatif $justificatif): self
  1167.     {
  1168.         if (!$this->justificatifs->contains($justificatif)) {
  1169.             $this->justificatifs->add($justificatif);
  1170.             $justificatif->setDossier($this);
  1171.         }
  1172.         return $this;
  1173.     }
  1174.     public function removeJustificatif(EmargementJustificatif $justificatif): self
  1175.     {
  1176.         // set the owning side to null (unless already changed)
  1177.         if ($this->justificatifs->removeElement($justificatif) && $justificatif->getDossier() === $this) {
  1178.             $justificatif->setDossier(null);
  1179.         }
  1180.         return $this;
  1181.     }
  1182.     public function isRncp(): ?bool
  1183.     {
  1184.         return $this->rncp;
  1185.     }
  1186.     public function setRncp(?bool $rncp): self
  1187.     {
  1188.         $this->rncp $rncp;
  1189.         return $this;
  1190.     }
  1191.     public function getDiplome(): ?Diplome
  1192.     {
  1193.         return $this->diplome;
  1194.     }
  1195.     public function setDiplome(?Diplome $diplome): Dossier
  1196.     {
  1197.         $this->diplome $diplome;
  1198.         return $this;
  1199.     }
  1200.     /**
  1201.      * @throws JsonException
  1202.      */
  1203.     public function addCart(string $idModulestring $intitule): self
  1204.     {
  1205.         $exit false;
  1206.         $items $this->getCart();
  1207.         foreach ($items as $item) {
  1208.             if ($item['id'] === $idModule) {
  1209.                 $exit true;
  1210.             }
  1211.         }
  1212.         if (!$exit) {
  1213.             $items[] = [
  1214.                 'id' => $idModule,
  1215.                 'intitule' => $intitule,
  1216.             ];
  1217.         }
  1218.         $this->cart json_encode($itemsJSON_THROW_ON_ERROR);
  1219.         return $this;
  1220.     }
  1221.     public function getCart()
  1222.     {
  1223.         if ($this->cart === null) {
  1224.             return [];
  1225.         }
  1226.         return json_decode($this->carttrue512JSON_THROW_ON_ERROR);
  1227.     }
  1228.     public function setCart(?string $cart): self
  1229.     {
  1230.         $this->cart $cart;
  1231.         return $this;
  1232.     }
  1233.     /**
  1234.      * @throws JsonException
  1235.      */
  1236.     public function removeCart(int $idModule): self
  1237.     {
  1238.         $items $this->getCart();
  1239.         if (array_key_exists($idModule$items)) {
  1240.             unset($items[$idModule]);
  1241.         }
  1242.         $this->cart json_encode($itemsJSON_THROW_ON_ERROR);
  1243.         return $this;
  1244.     }
  1245.     public function removeCarts(): self
  1246.     {
  1247.         $this->cart NULL;
  1248.         return $this;
  1249.     }
  1250.     public function getResultat(): ?Masterlistelg
  1251.     {
  1252.         return $this->resultat;
  1253.     }
  1254.     public function setResultat(?Masterlistelg $resultat): self
  1255.     {
  1256.         $this->resultat $resultat;
  1257.         return $this;
  1258.     }
  1259.     public function getStopProof(): ?Upload
  1260.     {
  1261.         return $this->stopProof;
  1262.     }
  1263.     public function setStopProof(?Upload $stopProof): self
  1264.     {
  1265.         $this->stopProof $stopProof;
  1266.         return $this;
  1267.     }
  1268.     public function getStopCause(): ?Masterlistelg
  1269.     {
  1270.         return $this->stopCause;
  1271.     }
  1272.     public function setStopCause(?Masterlistelg $stopCause): self
  1273.     {
  1274.         $this->stopCause $stopCause;
  1275.         return $this;
  1276.     }
  1277.     public function getStopType(): ?Masterlistelg
  1278.     {
  1279.         return $this->stopType;
  1280.     }
  1281.     public function setStopType(?Masterlistelg $stopType): self
  1282.     {
  1283.         $this->stopType $stopType;
  1284.         return $this;
  1285.     }
  1286.     public function getStopDate(): ?DateTime
  1287.     {
  1288.         return $this->stopDate;
  1289.     }
  1290.     public function setStopDate(?DateTime $stopDate): self
  1291.     {
  1292.         $this->stopDate $stopDate;
  1293.         return $this;
  1294.     }
  1295.     public function &getCompetenceById(int $blocIdint $id): ?array
  1296.     {
  1297.         $blocsCompetences $this->getCompetences();
  1298.         return $blocsCompetences[$blocId]['competences'][$id];
  1299.     }
  1300.     public function getCompetences(): array
  1301.     {
  1302.         return $this->competences json_decode($this->competencestrue) : [];
  1303.     }
  1304.     public function setCompetences(array $competences): self
  1305.     {
  1306.         $this->competences json_encode($competences);
  1307.         return $this;
  1308.     }
  1309.     public function addCompetence(int $blocIdstring $intituleBlocint $idstring $intitulestring $resultstring $commentaire): self
  1310.     {
  1311.         // Décodez les compétences existantes
  1312.         $blocsCompetences $this->getCompetences();
  1313.         // Si le bloc n'existe pas encore, initialisez-le
  1314.         if (!isset($blocsCompetences[$blocId])) {
  1315.             $blocsCompetences[$blocId] = [
  1316.                 'intitule' => $intituleBloc,
  1317.                 'evaluation' => 0,
  1318.                 'id' => $blocId,
  1319.                 'competences' => []
  1320.             ];
  1321.         }
  1322.         // Référence au tableau de compétences du bloc
  1323.         $competences = &$blocsCompetences[$blocId]['competences'];
  1324.         // Mise à jour ou ajout de la compétence
  1325.         $found false;
  1326.         foreach ($competences as &$competence) {
  1327.             if ($competence['id'] == $id) {
  1328.                 $competence['intitule'] = $intitule;
  1329.                 $found true;
  1330.                 break;
  1331.             }
  1332.         }
  1333.         if (!$found) {
  1334.             $competences[$id] = [
  1335.                 'id' => $id,
  1336.                 'intitule' => $intitule,
  1337.                 'result' => $result,
  1338.                 'commentaire' => $commentaire
  1339.             ];
  1340.         }
  1341.         // Encodez les données mises à jour
  1342.         $this->competences json_encode($blocsCompetencesJSON_THROW_ON_ERROR);
  1343.         return $this;
  1344.     }
  1345.     public function editCompetence(int $blocIdstring $intituleBlocint $idstring $intitulestring $resultstring $commentaire): self
  1346.     {
  1347.         // Décodez les compétences existantes
  1348.         $blocsCompetences $this->getCompetences();
  1349.         // Si le bloc n'existe pas encore, initialisez-le
  1350.         if (!isset($blocsCompetences[$blocId])) {
  1351.             $blocsCompetences[$blocId] = [
  1352.                 'evaluation' => 0,
  1353.                 'intitule' => $intituleBloc,
  1354.                 'competences' => []
  1355.             ];
  1356.         }
  1357.         // Référence au tableau de compétences du bloc
  1358.         $competences = &$blocsCompetences[$blocId]['competences'];
  1359.         // Mise à jour ou ajout de la compétence
  1360.         $found false;
  1361.         foreach ($competences as &$competence) {
  1362.             if ($competence['id'] === $id) {
  1363.                 $competence['result'] = $result;
  1364.                 $competence['commentaire'] = $commentaire;
  1365.                 $found true;
  1366.                 break;
  1367.             }
  1368.         }
  1369.         if (!$found) {
  1370.             $competences[$id] = [
  1371.                 'id' => $id,
  1372.                 'intitule' => $intitule,
  1373.                 'result' => $result,
  1374.                 'commentaire' => $commentaire
  1375.             ];
  1376.         }
  1377.         // Encodez les données mises à jour
  1378.         $this->competences json_encode($blocsCompetencesJSON_THROW_ON_ERROR);
  1379.         return $this;
  1380.     }
  1381.     public function updateBlocEvaluation(int $blocIdint $evaluation): self
  1382.     {
  1383.         $blocsCompetences $this->getCompetences();
  1384.         if (isset($blocsCompetences[$blocId])) {
  1385.             $blocsCompetences[$blocId]['evaluation'] = $evaluation;
  1386.             $this->setCompetences($blocsCompetences);
  1387.         }
  1388.         return $this;
  1389.     }
  1390.     public function getBlocEvaluation(int $blocId): int
  1391.     {
  1392.         $blocsCompetences $this->getCompetences();
  1393.         return $blocsCompetences[$blocId]['evaluation'] ?? 0;
  1394.     }
  1395.     public function removeCompetence(int $blocIdint $id): self
  1396.     {
  1397.         $blocsCompetences $this->getCompetences();
  1398.         if (isset($blocsCompetences[$blocId])) {
  1399.             $competences = &$blocsCompetences[$blocId]['competences'];
  1400.             foreach ($competences as $key => $competence) {
  1401.                 if ($competence['id'] === $id) {
  1402.                     unset($competences[$key]);
  1403.                     $blocsCompetences[$blocId]['competences'] = array_values($competences);
  1404.                     $this->setCompetences($blocsCompetences);
  1405.                     break;
  1406.                 }
  1407.             }
  1408.         }
  1409.         return $this;
  1410.     }
  1411.     public function clearCompetences(): self
  1412.     {
  1413.         $this->competences null;
  1414.         return $this;
  1415.     }
  1416.     /**
  1417.      * @return Collection<int, Avertissement>
  1418.      */
  1419.     public function getAvertissements(): Collection
  1420.     {
  1421.         return $this->avertissements;
  1422.     }
  1423.     public function addAvertissement(Avertissement $avertissement): self
  1424.     {
  1425.         if (!$this->avertissements->contains($avertissement)) {
  1426.             $this->avertissements->add($avertissement);
  1427.             $avertissement->setDossier($this);
  1428.         }
  1429.         return $this;
  1430.     }
  1431.     public function removeAvertissement(Avertissement $avertissement): self
  1432.     {
  1433.         // set the owning side to null (unless already changed)
  1434.         if ($this->avertissements->removeElement($avertissement) && $avertissement->getDossier() === $this) {
  1435.             $avertissement->setDossier(null);
  1436.         }
  1437.         return $this;
  1438.     }
  1439.     public function getLinkedin(): ?string
  1440.     {
  1441.         return $this->linkedin;
  1442.     }
  1443.     public function setLinkedin(?string $linkedin): self
  1444.     {
  1445.         $this->linkedin $linkedin;
  1446.         return $this;
  1447.     }
  1448.     public function getPortfolio(): ?string
  1449.     {
  1450.         return $this->portfolio;
  1451.     }
  1452.     public function setPortfolio(?string $portfolio): self
  1453.     {
  1454.         $this->portfolio $portfolio;
  1455.         return $this;
  1456.     }
  1457.     public function getEmergencyContact(): ?Contact
  1458.     {
  1459.         return $this->emergencyContact;
  1460.     }
  1461.     public function setEmergencyContact(?Contact $emergencyContact): self
  1462.     {
  1463.         $this->emergencyContact $emergencyContact;
  1464.         return $this;
  1465.     }
  1466.     public function getStatutDeclaration(): ?bool
  1467.     {
  1468.         return $this->statutDeclaration;
  1469.     }
  1470.     public function setStatutDeclaration(?bool $statutDeclaration): self
  1471.     {
  1472.         $this->statutDeclaration $statutDeclaration;
  1473.         return $this;
  1474.     }
  1475.     public function getARepresentantLegal(): ?bool
  1476.     {
  1477.         return $this->aRepresentantLegal;
  1478.     }
  1479.     public function setARepresentantLegal(?bool $aRepresentantLegal): self
  1480.     {
  1481.         $this->aRepresentantLegal $aRepresentantLegal;
  1482.         return $this;
  1483.     }
  1484.     public function getLegalRepresentative(): ?Contact
  1485.     {
  1486.         return $this->legalRepresentative;
  1487.     }
  1488.     public function setLegalRepresentative(?Contact $legalRepresentative): self
  1489.     {
  1490.         $this->legalRepresentative $legalRepresentative;
  1491.         return $this;
  1492.     }
  1493.     public function getModaliteEnseignement(): ?string
  1494.     {
  1495.         return $this->modaliteEnseignement;
  1496.     }
  1497.     public function setModaliteEnseignement(?string $modaliteEnseignement): self
  1498.     {
  1499.         $this->modaliteEnseignement $modaliteEnseignement;
  1500.         return $this;
  1501.     }
  1502.     public function getDiplomant(): ?bool
  1503.     {
  1504.         return $this->diplomant;
  1505.     }
  1506.     public function setDiplomant(?bool $diplomant): self
  1507.     {
  1508.         $this->diplomant $diplomant;
  1509.         return $this;
  1510.     }
  1511.     public function getDelegueClasse(): ?bool
  1512.     {
  1513.         return $this->delegueClasse;
  1514.     }
  1515.     public function setDelegueClasse(?bool $delegueClasse): self
  1516.     {
  1517.         $this->delegueClasse $delegueClasse;
  1518.         return $this;
  1519.     }
  1520.     public function getEntrepriseContact(): ?Contact
  1521.     {
  1522.         return $this->entrepriseContact;
  1523.     }
  1524.     public function setEntrepriseContact(?Contact $entrepriseContact): self
  1525.     {
  1526.         $this->entrepriseContact $entrepriseContact;
  1527.         return $this;
  1528.     }
  1529.     public function isDiplomant(): ?bool
  1530.     {
  1531.         return $this->diplomant;
  1532.     }
  1533.     public function isARepresentantLegal(): ?bool
  1534.     {
  1535.         return $this->aRepresentantLegal;
  1536.     }
  1537.     /**
  1538.      * @return Collection<int, Facturation>
  1539.      */
  1540.     public function getFacturations(): Collection
  1541.     {
  1542.         return $this->facturations;
  1543.     }
  1544.     public function addFacturation(Facturation $facturation): self
  1545.     {
  1546.         if (!$this->facturations->contains($facturation)) {
  1547.             $this->facturations->add($facturation);
  1548.             $facturation->setDossier($this);
  1549.         }
  1550.         return $this;
  1551.     }
  1552.     public function removeFacturation(Facturation $facturation): self
  1553.     {
  1554.         // set the owning side to null (unless already changed)
  1555.         if ($this->facturations->removeElement($facturation) && $facturation->getDossier() === $this) {
  1556.             $facturation->setDossier(null);
  1557.         }
  1558.         return $this;
  1559.     }
  1560.     public function getEtablissement(): ?Etablissement
  1561.     {
  1562.         return $this->etablissement;
  1563.     }
  1564.     public function setEtablissement(?Etablissement $etablissement): self
  1565.     {
  1566.         $this->etablissement $etablissement;
  1567.         return $this;
  1568.     }
  1569.     public function getFemmeEloigne(): ?bool
  1570.     {
  1571.         return $this->femmeEloigne;
  1572.     }
  1573.     public function setFemmeEloigne(?bool $femmeEloigne): self
  1574.     {
  1575.         $this->femmeEloigne $femmeEloigne;
  1576.         return $this;
  1577.     }
  1578.     public function getZrr(): ?bool
  1579.     {
  1580.         return $this->zrr;
  1581.     }
  1582.     public function setZrr(?bool $zrr): self
  1583.     {
  1584.         $this->zrr $zrr;
  1585.         return $this;
  1586.     }
  1587.     public function getQpv(): ?bool
  1588.     {
  1589.         return $this->qpv;
  1590.     }
  1591.     public function setQpv(?bool $qpv): self
  1592.     {
  1593.         $this->qpv $qpv;
  1594.         return $this;
  1595.     }
  1596.     public function isDelegueClasse(): ?bool
  1597.     {
  1598.         return $this->delegueClasse;
  1599.     }
  1600.     public function isStatutDeclaration(): ?bool
  1601.     {
  1602.         return $this->statutDeclaration;
  1603.     }
  1604.     public function isFemmeEloigne(): ?bool
  1605.     {
  1606.         return $this->femmeEloigne;
  1607.     }
  1608.     public function isZrr(): ?bool
  1609.     {
  1610.         return $this->zrr;
  1611.     }
  1612.     public function isQpv(): ?bool
  1613.     {
  1614.         return $this->qpv;
  1615.     }
  1616.     /**
  1617.      * @throws JsonException
  1618.      */
  1619.     public function getPanier()
  1620.     {
  1621.         if ($this->panier === null) {
  1622.             return [];
  1623.         }
  1624.         return json_decode($this->paniertrue512JSON_THROW_ON_ERROR);
  1625.     }
  1626.     public function setPanier(?string $panier): self
  1627.     {
  1628.         $this->panier $panier;
  1629.         return $this;
  1630.     }
  1631.     /**
  1632.      * @throws JsonException
  1633.      */
  1634.     public function removePanier(int $panierId): self
  1635.     {
  1636.         $items $this->getPanier();
  1637.         if (array_key_exists($panierId$items)) {
  1638.             unset($items[$panierId]);
  1639.         }
  1640.         $this->panier json_encode($itemsJSON_THROW_ON_ERROR);
  1641.         return $this;
  1642.     }
  1643.     public function clearsPanier(): self
  1644.     {
  1645.         $this->panier NULL;
  1646.         return $this;
  1647.     }
  1648.     /**
  1649.      * @throws JsonException
  1650.      */
  1651.     public function addPanier(
  1652.         ?string $idEvent,
  1653.         ?int $idModule,
  1654.         ?string $intituleModule,
  1655.         ?string $codeModule,
  1656.         ?string $idSession,
  1657.         ?string $intituleSession,
  1658.         ?string $start,
  1659.         ?string $end,
  1660.         ?int    $duree,
  1661.     ): self
  1662.     {
  1663.         $items $this->getPanier();
  1664.         $items[] = [
  1665.             'id' => $idEvent,
  1666.             'idModule' => $idModule,
  1667.             'intitule_module' => $intituleModule,
  1668.             'code_module' => $codeModule,
  1669.             'id_session' => $idSession,
  1670.             'intitule_session' => $intituleSession,
  1671.             'start' => $start,
  1672.             'end' => $end,
  1673.             'duree' => $duree,
  1674.         ];
  1675.         $this->panier json_encode($itemsJSON_THROW_ON_ERROR);
  1676.         return $this;
  1677.     }
  1678.     /**
  1679.      * @return Collection<int, QuizReponse>
  1680.      */
  1681.     public function getFormulaireReponses(): Collection
  1682.     {
  1683.         return $this->formulaireReponses;
  1684.     }
  1685.     public function addFormulaireReponse(QuizReponse $formulaireReponse): self
  1686.     {
  1687.         if (!$this->formulaireReponses->contains($formulaireReponse)) {
  1688.             $this->formulaireReponses->add($formulaireReponse);
  1689.           //  $formulaireReponse->setDossier($this);
  1690.         }
  1691.         return $this;
  1692.     }
  1693.     public function removeFormulaireReponse(QuizReponse $formulaireReponse): self
  1694.     {
  1695.         if ($this->formulaireReponses->removeElement($formulaireReponse)) {
  1696.             // set the owning side to null (unless already changed)
  1697.            // if ($formulaireReponse->getDossier() === $this) {
  1698.             //    $formulaireReponse->setDossier(null);
  1699.            // }
  1700.         }
  1701.         return $this;
  1702.     }
  1703.     public function hasAnsweredQuiz(Quiz $quiz): bool
  1704.     {
  1705.         foreach ($this->dossierQuizzs as $dossierQuiz) {
  1706.             if ($dossierQuiz->getQuiz() === $quiz && $dossierQuiz->isCompleted()) {
  1707.                 return true;
  1708.             }
  1709.         }
  1710.         return false;
  1711.     }
  1712.     /**
  1713.      * Ajoute un log d'email envoyé
  1714.      */
  1715.     public function addEmailLog(array $logData): self
  1716.     {
  1717.         $this->emailLogs[] = array_merge([
  1718.             'sent_at' => (new \DateTime())->format('c')
  1719.         ], $logData);
  1720.         return $this;
  1721.     }
  1722.     /**
  1723.      * Récupère le dernier email envoyé d'un type donné
  1724.      */
  1725.     public function getLastEmailSent(string $emailCode): ?array
  1726.     {
  1727.         $filtered array_filter($this->emailLogs, static fn($log) => ($log['email_code'] ?? null) === $emailCode);
  1728.         if (empty($filtered)) {
  1729.             return null;
  1730.         }
  1731.         usort($filtered, static fn($a$b) => strtotime($b['sent_at']) <=> strtotime($a['sent_at']));
  1732.         return reset($filtered);
  1733.     }
  1734.     /**
  1735.      * Vérifie si un email a été envoyé récemment
  1736.      */
  1737.     public function wasEmailSentRecently(int $emailIdstring $interval '6 hours'): bool
  1738.     {
  1739.         $lastSent $this->getLastEmailSent($emailId);
  1740.         if (!$lastSent) {
  1741.             return false;
  1742.         }
  1743.         $lastSentDate = new \DateTime($lastSent['sent_at']);
  1744.         $now = new \DateTime();
  1745.         return $lastSentDate $now->sub(\DateInterval::createFromDateString($interval));
  1746.     }
  1747.     /**
  1748.      * @throws JsonException
  1749.      */
  1750.     public function getEmailLogs(): array
  1751.     {
  1752.         return $this->emailLogs ?? [];
  1753.     }
  1754. }