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