src/Entity/Gestiform/Formations/Catalogue/Module/Module.php line 36

  1. <?php
  2. namespace App\Entity\Gestiform\Formations\Catalogue\Module;
  3. use App\Entity\AbstractEntity;
  4. use App\Entity\Common\Document;
  5. use App\Entity\Common\Upload;
  6. use App\Entity\Gestiform\Admin\ApiGestiform;
  7. use App\Entity\Gestiform\Admin\MasterListe\Masterlistelg;
  8. use App\Entity\Gestiform\Admin\Societe;
  9. use App\Entity\Gestiform\Admin\Tarifs\TarifVenteTheme;
  10. use App\Entity\Gestiform\Admin\Tarifs\TarifVenteThemeIntra;
  11. use App\Entity\Gestiform\Formations\Catalogue\Certification;
  12. use App\Entity\Gestiform\Formations\Catalogue\Parcours\Bloc\BlocModule;
  13. use App\Entity\Gestiform\Formations\Catalogue\Theme\SousThemeTheme;
  14. use App\Entity\Gestiform\Formations\Catalogue\Theme\Theme;
  15. use App\Entity\Gestiform\Formations\Financeur\Financeur;
  16. use App\Entity\Gestiform\Formations\Formateur\FormateurModule;
  17. use App\Entity\Gestiform\Formations\Session\Planning\Event;
  18. use App\Entity\Trait\ApiGestiformEntity;
  19. use App\Repository\Gestiform\Formations\Catalogue\Module\ModuleRepository;
  20. use DateTime;
  21. use Doctrine\Common\Collections\ArrayCollection;
  22. use Doctrine\Common\Collections\Collection;
  23. use Doctrine\ORM\Mapping as ORM;
  24. use Symfony\Component\Validator\Constraints as Assert;
  25. #[ORM\Entity(repositoryClassModuleRepository::class)]
  26. #[ORM\InheritanceType('JOINED')]
  27. #[ORM\DiscriminatorColumn(name'type'type'string')]
  28. #[ORM\DiscriminatorMap(['module' => 'Module''certification' => Certification::class])]
  29. class Module extends AbstractEntity
  30. {
  31.     use ApiGestiformEntity;
  32.     #[ORM\Column(type'string'length255nullablefalse)]
  33.     private string $intitule;
  34.     #[ORM\Column(type'integer'nullabletrue)]
  35.     private ?int $duree null;
  36.     #[ORM\Column(type'boolean'nullabletrue)]
  37.     private ?bool $publie false;
  38.     #[ORM\Column(type'boolean'nullabletrue)]
  39.     private ?bool $cpf false;
  40.     #[ORM\Column(type'boolean'nullabletrue)]
  41.     private ?bool $certifiantes false;
  42.     #[ORM\Column(type'boolean')]
  43.     private bool $isDefault false;
  44.     #[ORM\Column(type'boolean'nullabletrue)]
  45.     private bool $certifiante false;
  46.     #[ORM\Column(type'string'length255nullabletrue)]
  47.     private ?string $code null;
  48.     #[ORM\Column(type'text'nullabletrue)]
  49.     private ?string $modalitepedagogiques null;
  50.     #[ORM\Column(type'text'nullabletrue)]
  51.     private ?string $statistiques null;
  52.     #[ORM\Column(type'text'nullabletrue)]
  53.     private ?string $modaliteevaluationinitial null;
  54.     #[ORM\Column(type'text'nullabletrue)]
  55.     private ?string $modaliteevaluationfinal null;
  56.     #[ORM\Column(type'string'length255nullabletrue)]
  57.     private ?string $path null;
  58.     #[ORM\Column(type'string'length255nullabletrue)]
  59.     private ?string $codeCpf null;
  60.     #[ORM\Column(type'string'length255nullabletrue)]
  61.     private ?string $codeCpfSalarie null;
  62.     #[ORM\Column(type'string'length255nullabletrue)]
  63.     private ?string $codeCpfDemandeurEmploi null;
  64.     #[ORM\Column(type'decimal'precision10scale0nullabletrue)]
  65.     private ?float $tarifInterJour null;
  66.     #[ORM\Column(type'decimal'precision10scale0nullabletrue)]
  67.     private ?float $tarifInterHoraire null;
  68.     #[ORM\Column(type'decimal'precision10scale0nullabletrue)]
  69.     private ?float $tarifIntraJour null;
  70.     #[ORM\Column(type'decimal'precision10scale0nullabletrue)]
  71.     private ?float $tarifIntraHoraire null;
  72.     #[ORM\Column(type'decimal'precision10scale0nullabletrue)]
  73.     private ?float $tarifJury null;
  74.     #[ORM\Column(type'decimal'precision10scale0nullabletrue)]
  75.     private ?float $tarifJury2 null;
  76.     #[ORM\Column(type'boolean'nullabletrue)]
  77.     private ?bool $tarifJuryTtc null;
  78.     #[ORM\Column(type'text'nullabletrue)]
  79.     private ?string $prerequis null;
  80.     #[ORM\Column(type'text'nullabletrue)]
  81.     private ?string $objectif null;
  82.     #[ORM\Column(type'text'nullabletrue)]
  83.     private ?string $plus null;
  84.     #[ORM\Column(type'text'nullabletrue)]
  85.     private ?string $public null;
  86.     #[ORM\Column(type'string'length255nullabletrue)]
  87.     private ?string $commentaire null;
  88.     #[ORM\Column(type'text'nullabletrue)]
  89.     private ?string $certificationCommentaire null;
  90.     #[ORM\Column(type'string'length255nullabletrue)]
  91.     private ?string $seoTitre null;
  92.     #[ORM\Column(type'string'length255nullabletrue)]
  93.     private ?string $seoDescription null;
  94.     #[ORM\Column(type'text'nullabletrue)]
  95.     private ?string $infoPratique null;
  96.     #[ORM\Column(type'text'nullabletrue)]
  97.     #[Assert\NotBlank(message'Ce champ est obligatoire.'groups: ['module'])]
  98.     private ?string $accessibiliteHandicap null;
  99.     #[ORM\Column(type'string'length255nullabletrue)]
  100.     private ?string $altVignette null;
  101.     #[ORM\Column(type'text'nullabletrue)]
  102.     private ?string $description null;
  103.     #[ORM\Column(type'text'nullabletrue)]
  104.     private ?string $modalitesDelaisAcces null;
  105.     #[ORM\Column(type'string'length255nullabletrue)]
  106.     private ?string $altBanniere null;
  107.     #[ORM\Column(type'string'length255nullabletrue)]
  108.     private ?string $identifiantDokelio null;
  109.     #[ORM\Column(type'boolean'nullabletrue)]
  110.     private ?bool $publication false;
  111.     #[ORM\Column(type'text'nullabletrue)]
  112.     private ?string $contenuApres null;
  113.     #[ORM\Column(type'text'nullabletrue)]
  114.     private ?string $contenuAvant null;
  115.     #[ORM\Column(name'tauxObtention'type'text'nullabletrue)]
  116.     private ?string $tauxObtention null;
  117.     #[ORM\Column(name'tauxAbandon'type'text'nullabletrue)]
  118.     private ?string $tauxAbandon null;
  119.     #[ORM\Column(name'tauxSatisfaction'type'text'nullabletrue)]
  120.     private ?string $tauxSatisfaction null;
  121.     #[ORM\Column(name'tauxPourSuiteEtude'type'text'nullabletrue)]
  122.     private ?string $tauxPourSuiteEtude null;
  123.     #[ORM\Column(name'tauxEmployabilite'type'text'nullabletrue)]
  124.     private ?string $tauxEmployabilite null;
  125.     #[ORM\Column(name'salaireMoyen'type'text'nullabletrue)]
  126.     private ?string $salaireMoyen null;
  127.     #[ORM\Column(type'integer'nullabletrue)]
  128.     private ?int $nbrsessioninter null;
  129.     #[ORM\Column(type'integer'nullabletrue)]
  130.     private ?int $nbrsessionintra null;
  131.     #[ORM\OneToMany(mappedBy'module'targetEntityEvent::class)]
  132.     private Collection $events;
  133.     #[ORM\OneToMany(mappedBy'module'targetEntityBlocModule::class, cascade: ['persist'])]
  134.     private Collection $blocModules;
  135.     #[ORM\OneToMany(mappedBy'module'targetEntityChapitre::class, cascade: ['persist'])]
  136.     private Collection $chapitres;
  137.     #[ORM\JoinColumn(nullabletrue)]
  138.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  139.     private ?Masterlistelg $modeFormation null;
  140.     #[ORM\Column(type'json'nullabletrue)]
  141.     private ?array $modesFormation null;
  142.     #[ORM\JoinColumn(nullabletrue)]
  143.     #[ORM\ManyToOne(targetEntitySousThemeTheme::class, inversedBy'modules')]
  144.     private ?SousThemeTheme $sousThemeTheme null;
  145.     #[ORM\ManyToOne(targetEntityTheme::class)]
  146.     private ?Theme $themeTarif null;
  147.     #[ORM\JoinTable(name'module_exige_avant')]
  148.     #[ORM\ManyToMany(targetEntityModule::class)]
  149.     private Collection $modulesExigeAvant;
  150.     #[ORM\JoinTable(name'module_souhaitable_avant')]
  151.     #[ORM\ManyToMany(targetEntityModule::class)]
  152.     private Collection $modulesSouhaitableAvant;
  153.     #[ORM\JoinTable(name'module_conseille_apres')]
  154.     #[ORM\ManyToMany(targetEntityModule::class)]
  155.     private Collection $modulesConseilleApres;
  156.     #[ORM\OneToMany(mappedBy'module'targetEntityModuleCompetence::class, cascade: ['persist'])]
  157.     private Collection $moduleCompetences;
  158.     #[ORM\ManyToMany(targetEntityFinanceur::class, inversedBy'modules'cascade: ['persist'])]
  159.     private Collection $financeurs;
  160.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  161.     private ?Masterlistelg $niveaumateriel null;
  162.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  163.     private ?Masterlistelg $niveautechnique null;
  164.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  165.     private ?Masterlistelg $autoriteDelivranceCpf null;
  166.     #[ORM\JoinColumn(nullabletrue)]
  167.     #[ORM\OneToMany(mappedBy'module'targetEntityModuleModaliteEvaluationFinale::class, cascade: ['persist'])]
  168.     private Collection $moduleModaliteEvaluationFinales;
  169.     #[ORM\JoinColumn(nullabletrue)]
  170.     #[ORM\ManyToOne(targetEntityUpload::class, cascade: ['persist''remove'])]
  171.     private ?Upload $banniere null;
  172.     #[ORM\JoinColumn(nullabletrue)]
  173.     #[ORM\ManyToOne(targetEntityUpload::class, cascade: ['persist''remove'])]
  174.     private ?Upload $vignette null;
  175.     #[ORM\OneToMany(mappedBy'module'targetEntityFormateurModule::class)]
  176.     private Collection $formateurModules;
  177.     #[ORM\OneToMany(mappedBy'module'targetEntityTarifVenteTheme::class, cascade: ['persist''remove'])]
  178.     private Collection $tarifsVentes;
  179.     #[ORM\OneToMany(mappedBy'module'targetEntityTarifVenteThemeIntra::class, cascade: ['persist''remove'])]
  180.     private Collection $tarifsVenteIntras;
  181.     #[ORM\ManyToMany(targetEntityCertification::class, inversedBy'modules'cascade: ['persist'])]
  182.     private Collection $certifications;
  183.     #[ORM\OneToMany(mappedBy'module'targetEntityDocument::class, cascade: ['persist'])]
  184.     private Collection $documents;
  185.     public function __construct()
  186.     {
  187.         $this->certifications = new ArrayCollection();
  188.         $this->blocModules = new ArrayCollection();
  189.         $this->chapitres = new ArrayCollection();
  190.         $this->modulesExigeAvant = new ArrayCollection();
  191.         $this->modulesSouhaitableAvant = new ArrayCollection();
  192.         $this->modulesConseilleApres = new ArrayCollection();
  193.         $this->moduleCompetences = new ArrayCollection();
  194.         $this->financeurs = new ArrayCollection();
  195.         $this->moduleModaliteEvaluationFinales = new ArrayCollection();
  196.         $this->formateurModules = new ArrayCollection();
  197.         $this->tarifsVentes = new ArrayCollection();
  198.         $this->tarifsVenteIntras = new ArrayCollection();
  199.         $this->events = new ArrayCollection();
  200.         $this->documents = new ArrayCollection();
  201.     }
  202.     public function getIntitule(): ?string
  203.     {
  204.         return $this->intitule;
  205.     }
  206.     public function setIntitule(string $intitule): self
  207.     {
  208.         $this->intitule $intitule;
  209.         return $this;
  210.     }
  211.     public function getTarifJury2(): ?float
  212.     {
  213.         return $this->tarifJury2;
  214.     }
  215.     public function setTarifJury2(?float $tarifJury2): self
  216.     {
  217.         $this->tarifJury2 $tarifJury2;
  218.         return $this;
  219.     }
  220.     public function isTarifJuryTtc(): ?bool
  221.     {
  222.         return $this->tarifJuryTtc;
  223.     }
  224.     public function setTarifJuryTtc(?bool $tarifJuryTtc): self
  225.     {
  226.         $this->tarifJuryTtc $tarifJuryTtc;
  227.         return $this;
  228.     }
  229.     /**
  230.      * Helper to access the default company without exposing ApiGestiform upstream.
  231.      */
  232.     public function tSocieteParDefaut(): ?Societe
  233.     {
  234.         return $this->getApiGestiform()?->getSocieteParDefaut();
  235.     }
  236.     public function getDuree(): ?int
  237.     {
  238.         return $this->duree;
  239.     }
  240.     public function setDuree(?int $duree): self
  241.     {
  242.         $this->duree $duree;
  243.         return $this;
  244.     }
  245.     public function getModesFormation(): array
  246.     {
  247.         return $this->modesFormation ?? [];
  248.     }
  249.     public function setModesFormation(?array $modesFormation): self
  250.     {
  251.         $this->modesFormation $modesFormation;
  252.         return $this;
  253.     }
  254.     public function isCertifiante(): ?bool
  255.     {
  256.         return $this->certifiante;
  257.     }
  258.     public function setCertifiante(?bool $certifiante): self
  259.     {
  260.         $this->certifiante $certifiante;
  261.         return $this;
  262.     }
  263.     public function getCode(): ?string
  264.     {
  265.         return $this->code;
  266.     }
  267.     public function setCode(?string $code): self
  268.     {
  269.         $this->code $code;
  270.         return $this;
  271.     }
  272.     public function getPath(): ?string
  273.     {
  274.         return $this->path;
  275.     }
  276.     public function setPath(?string $path): self
  277.     {
  278.         $this->path $path;
  279.         return $this;
  280.     }
  281.     public function isCpf(): ?bool
  282.     {
  283.         return $this->cpf;
  284.     }
  285.     public function setCpf(?bool $cpf): self
  286.     {
  287.         $this->cpf $cpf;
  288.         return $this;
  289.     }
  290.     public function getPublie(): ?bool
  291.     {
  292.         return $this->publie;
  293.     }
  294.     public function setPublie(?bool $publie): self
  295.     {
  296.         $this->publie $publie;
  297.         return $this;
  298.     }
  299.     public function getCertifiantes(): ?bool
  300.     {
  301.         return $this->certifiantes;
  302.     }
  303.     public function setCertifiantes(?bool $certifiantes): self
  304.     {
  305.         $this->certifiantes $certifiantes;
  306.         return $this;
  307.     }
  308.     public function getCodeCpf(): ?string
  309.     {
  310.         return $this->codeCpf;
  311.     }
  312.     public function setCodeCpf(?string $codeCpf): self
  313.     {
  314.         $this->codeCpf $codeCpf;
  315.         return $this;
  316.     }
  317.     public function getCodeCpfSalarie(): ?string
  318.     {
  319.         return $this->codeCpfSalarie;
  320.     }
  321.     public function setCodeCpfSalarie(?string $codeCpfSalarie): self
  322.     {
  323.         $this->codeCpfSalarie $codeCpfSalarie;
  324.         return $this;
  325.     }
  326.     public function getCodeCpfDemandeurEmploi(): ?string
  327.     {
  328.         return $this->codeCpfDemandeurEmploi;
  329.     }
  330.     public function setCodeCpfDemandeurEmploi(?string $codeCpfDemandeurEmploi): self
  331.     {
  332.         $this->codeCpfDemandeurEmploi $codeCpfDemandeurEmploi;
  333.         return $this;
  334.     }
  335.     public function getTarifInterJour(): ?string
  336.     {
  337.         return $this->tarifInterJour;
  338.     }
  339.     public function setTarifInterJour(?string $tarifInterJour): self
  340.     {
  341.         $this->tarifInterJour $tarifInterJour;
  342.         return $this;
  343.     }
  344.     public function getTarifInterHoraire(): ?string
  345.     {
  346.         return $this->tarifInterHoraire;
  347.     }
  348.     public function setTarifInterHoraire(?string $tarifInterHoraire): self
  349.     {
  350.         $this->tarifInterHoraire $tarifInterHoraire;
  351.         return $this;
  352.     }
  353.     public function getTarifIntraJour(): ?string
  354.     {
  355.         return $this->tarifIntraJour;
  356.     }
  357.     public function setTarifIntraJour(?string $tarifIntraJour): self
  358.     {
  359.         $this->tarifIntraJour $tarifIntraJour;
  360.         return $this;
  361.     }
  362.     public function getTarifIntraHoraire(): ?string
  363.     {
  364.         return $this->tarifIntraHoraire;
  365.     }
  366.     public function setTarifIntraHoraire(?string $tarifIntraHoraire): self
  367.     {
  368.         $this->tarifIntraHoraire $tarifIntraHoraire;
  369.         return $this;
  370.     }
  371.     public function getTarifJury(): ?float
  372.     {
  373.         return $this->tarifJury;
  374.     }
  375.     public function setTarifJury(?float $tarifJury): self
  376.     {
  377.         $this->tarifJury $tarifJury;
  378.         return $this;
  379.     }
  380.     public function getPrerequis(): ?string
  381.     {
  382.         return $this->prerequis;
  383.     }
  384.     public function setPrerequis(?string $prerequis): self
  385.     {
  386.         $this->prerequis $prerequis;
  387.         return $this;
  388.     }
  389.     public function getObjectif(): ?string
  390.     {
  391.         return $this->objectif;
  392.     }
  393.     public function setObjectif(?string $objectif): self
  394.     {
  395.         $this->objectif $objectif;
  396.         return $this;
  397.     }
  398.     public function getPlus(): ?string
  399.     {
  400.         return $this->plus;
  401.     }
  402.     public function setPlus(?string $plus): self
  403.     {
  404.         $this->plus $plus;
  405.         return $this;
  406.     }
  407.     public function getPublic(): ?string
  408.     {
  409.         return $this->public;
  410.     }
  411.     public function setPublic(?string $public): self
  412.     {
  413.         $this->public $public;
  414.         return $this;
  415.     }
  416.     public function getCommentaire(): ?string
  417.     {
  418.         return $this->commentaire;
  419.     }
  420.     public function setCommentaire(?string $commentaire): self
  421.     {
  422.         $this->commentaire $commentaire;
  423.         return $this;
  424.     }
  425.     public function getCertificationCommentaire(): ?string
  426.     {
  427.         return $this->certificationCommentaire;
  428.     }
  429.     public function setCertificationCommentaire(?string $certificationCommentaire): self
  430.     {
  431.         $this->certificationCommentaire $certificationCommentaire;
  432.         return $this;
  433.     }
  434.     public function getSeoTitre(): ?string
  435.     {
  436.         return $this->seoTitre;
  437.     }
  438.     public function setSeoTitre(?string $seoTitre): self
  439.     {
  440.         $this->seoTitre $seoTitre;
  441.         return $this;
  442.     }
  443.     public function getSeoDescription(): ?string
  444.     {
  445.         return $this->seoDescription;
  446.     }
  447.     public function setSeoDescription(?string $seoDescription): self
  448.     {
  449.         $this->seoDescription $seoDescription;
  450.         return $this;
  451.     }
  452.     public function getInfoPratique(): ?string
  453.     {
  454.         return $this->infoPratique;
  455.     }
  456.     public function setInfoPratique(?string $infoPratique): self
  457.     {
  458.         $this->infoPratique $infoPratique;
  459.         return $this;
  460.     }
  461.     public function getAccessibiliteHandicap(): ?string
  462.     {
  463.         return $this->accessibiliteHandicap;
  464.     }
  465.     public function setAccessibiliteHandicap(?string $accessibiliteHandicap): self
  466.     {
  467.         $this->accessibiliteHandicap $accessibiliteHandicap;
  468.         return $this;
  469.     }
  470.     public function getAltVignette(): ?string
  471.     {
  472.         return $this->altVignette;
  473.     }
  474.     public function setAltVignette(?string $altVignette): self
  475.     {
  476.         $this->altVignette $altVignette;
  477.         return $this;
  478.     }
  479.     public function getDescription(): ?string
  480.     {
  481.         return $this->description;
  482.     }
  483.     public function setDescription(?string $description): self
  484.     {
  485.         $this->description $description;
  486.         return $this;
  487.     }
  488.     public function getModalitesDelaisAcces(): ?string
  489.     {
  490.         return $this->modalitesDelaisAcces;
  491.     }
  492.     public function setModalitesDelaisAcces(?string $modalitesDelaisAcces): self
  493.     {
  494.         $this->modalitesDelaisAcces $modalitesDelaisAcces;
  495.         return $this;
  496.     }
  497.     public function getAltBanniere(): ?string
  498.     {
  499.         return $this->altBanniere;
  500.     }
  501.     public function setAltBanniere(?string $altBanniere): self
  502.     {
  503.         $this->altBanniere $altBanniere;
  504.         return $this;
  505.     }
  506.     public function getIdentifiantDokelio(): ?string
  507.     {
  508.         return $this->identifiantDokelio;
  509.     }
  510.     public function setIdentifiantDokelio(?string $identifiantDokelio): self
  511.     {
  512.         $this->identifiantDokelio $identifiantDokelio;
  513.         return $this;
  514.     }
  515.     public function isPublication(): ?bool
  516.     {
  517.         return $this->publication;
  518.     }
  519.     public function setPublication(?bool $publication): self
  520.     {
  521.         $this->publication $publication;
  522.         return $this;
  523.     }
  524.     public function getContenuApres(): ?string
  525.     {
  526.         return $this->contenuApres;
  527.     }
  528.     public function setContenuApres(?string $contenuApres): self
  529.     {
  530.         $this->contenuApres $contenuApres;
  531.         return $this;
  532.     }
  533.     public function getModalitepedagogiques(): ?string
  534.     {
  535.         return $this->modalitepedagogiques;
  536.     }
  537.     public function setModalitepedagogiques(?string $modalitepedagogiques): self
  538.     {
  539.         $this->modalitepedagogiques $modalitepedagogiques;
  540.         return $this;
  541.     }
  542.     public function getStatistiques(): ?string
  543.     {
  544.         return $this->statistiques;
  545.     }
  546.     public function setStatistiques(?string $statistiques): self
  547.     {
  548.         $this->statistiques $statistiques;
  549.         return $this;
  550.     }
  551.     public function getModaliteevaluationinitial(): ?string
  552.     {
  553.         return $this->modaliteevaluationinitial;
  554.     }
  555.     public function setModaliteevaluationinitial(?string $modaliteevaluationinitial): self
  556.     {
  557.         $this->modaliteevaluationinitial $modaliteevaluationinitial;
  558.         return $this;
  559.     }
  560.     public function getModaliteevaluationfinal(): ?string
  561.     {
  562.         return $this->modaliteevaluationfinal;
  563.     }
  564.     public function setModaliteevaluationfinal(?string $modaliteevaluationfinal): self
  565.     {
  566.         $this->modaliteevaluationfinal $modaliteevaluationfinal;
  567.         return $this;
  568.     }
  569.     public function getContenuAvant(): ?string
  570.     {
  571.         return $this->contenuAvant;
  572.     }
  573.     public function setContenuAvant(?string $contenuAvant): self
  574.     {
  575.         $this->contenuAvant $contenuAvant;
  576.         return $this;
  577.     }
  578.     /**
  579.      * @return Collection<int, BlocModule>
  580.      */
  581.     public function getBlocModules(): Collection
  582.     {
  583.         return $this->blocModules;
  584.     }
  585.     public function setBlocModules(Collection $blocModules): self
  586.     {
  587.         $this->blocModules $blocModules;
  588.         return $this;
  589.     }
  590.     public function addBlocModule(BlocModule $blocModule): self
  591.     {
  592.         if (!$this->blocModules->contains($blocModule)) {
  593.             $this->blocModules->add($blocModule);
  594.             $blocModule->setModule($this);
  595.         }
  596.         return $this;
  597.     }
  598.     public function removeBlocModule(BlocModule $blocModule): self
  599.     {
  600.         // set the owning side to null (unless already changed)
  601.         if ($this->blocModules->removeElement($blocModule) && $blocModule->getModule() === $this) {
  602.             $blocModule->setModule(null);
  603.         }
  604.         return $this;
  605.     }
  606.     /**
  607.      * @return Collection<int, Chapitre>
  608.      */
  609.     public function getChapitres(): Collection
  610.     {
  611.         return $this->chapitres;
  612.     }
  613.     public function setChapitres(Collection $chapitres): self
  614.     {
  615.         $this->chapitres $chapitres;
  616.         return $this;
  617.     }
  618.     public function addChapitre(Chapitre $chapitre): self
  619.     {
  620.         if (!$this->chapitres->contains($chapitre)) {
  621.             $this->chapitres->add($chapitre);
  622.             $chapitre->setModule($this);
  623.         }
  624.         return $this;
  625.     }
  626.     public function removeChapitre(Chapitre $chapitre): self
  627.     {
  628.         // set the owning side to null (unless already changed)
  629.         if ($this->chapitres->removeElement($chapitre) && $chapitre->getModule() === $this) {
  630.             $chapitre->setModule(null);
  631.         }
  632.         return $this;
  633.     }
  634.     public function getModeFormation(): ?Masterlistelg
  635.     {
  636.         return $this->modeFormation;
  637.     }
  638.     public function setModeFormation(?Masterlistelg $modeFormation): self
  639.     {
  640.         $this->modeFormation $modeFormation;
  641.         return $this;
  642.     }
  643.     /**
  644.      * @return Collection<int, Module>
  645.      */
  646.     public function getModulesExigeAvant(): Collection
  647.     {
  648.         return $this->modulesExigeAvant;
  649.     }
  650.     public function addModulesExigeAvant(Module $modulesExigeAvant): self
  651.     {
  652.         if (!$this->modulesExigeAvant->contains($modulesExigeAvant)) {
  653.             $this->modulesExigeAvant->add($modulesExigeAvant);
  654.         }
  655.         return $this;
  656.     }
  657.     public function removeModulesExigeAvant(Module $modulesExigeAvant): self
  658.     {
  659.         $this->modulesExigeAvant->removeElement($modulesExigeAvant);
  660.         return $this;
  661.     }
  662.     /**
  663.      * @return Collection<int, Module>
  664.      */
  665.     public function getModulesSouhaitableAvant(): Collection
  666.     {
  667.         return $this->modulesSouhaitableAvant;
  668.     }
  669.     public function addModulesSouhaitableAvant(Module $modulesSouhaitableAvant): self
  670.     {
  671.         if (!$this->modulesSouhaitableAvant->contains($modulesSouhaitableAvant)) {
  672.             $this->modulesSouhaitableAvant->add($modulesSouhaitableAvant);
  673.         }
  674.         return $this;
  675.     }
  676.     public function removeModulesSouhaitableAvant(Module $modulesSouhaitableAvant): self
  677.     {
  678.         $this->modulesSouhaitableAvant->removeElement($modulesSouhaitableAvant);
  679.         return $this;
  680.     }
  681.     /**
  682.      * @return Collection<int, Module>
  683.      */
  684.     public function getModulesConseilleApres(): Collection
  685.     {
  686.         return $this->modulesConseilleApres;
  687.     }
  688.     public function addModulesConseilleApre(Module $modulesConseilleApre): self
  689.     {
  690.         if (!$this->modulesConseilleApres->contains($modulesConseilleApre)) {
  691.             $this->modulesConseilleApres->add($modulesConseilleApre);
  692.         }
  693.         return $this;
  694.     }
  695.     public function removeModulesConseilleApre(Module $modulesConseilleApre): self
  696.     {
  697.         $this->modulesConseilleApres->removeElement($modulesConseilleApre);
  698.         return $this;
  699.     }
  700.     /**
  701.      * @return Collection<int, ModuleCompetence>
  702.      */
  703.     public function getModuleCompetences(): Collection
  704.     {
  705.         return $this->moduleCompetences;
  706.     }
  707.     public function setModuleCompetences(Collection $moduleCompetences): self
  708.     {
  709.         $this->moduleCompetences $moduleCompetences;
  710.         return $this;
  711.     }
  712.     public function addModuleCompetence(ModuleCompetence $moduleCompetence): self
  713.     {
  714.         if (!$this->moduleCompetences->contains($moduleCompetence)) {
  715.             $this->moduleCompetences->add($moduleCompetence);
  716.             $moduleCompetence->setModule($this);
  717.         }
  718.         return $this;
  719.     }
  720.     public function removeModuleCompetence(ModuleCompetence $moduleCompetence): self
  721.     {
  722.         // set the owning side to null (unless already changed)
  723.         if ($this->moduleCompetences->removeElement($moduleCompetence) && $moduleCompetence->getModule() === $this) {
  724.             $moduleCompetence->setModule(null);
  725.         }
  726.         return $this;
  727.     }
  728.     /**
  729.      * @return Collection<int, Financeur>
  730.      */
  731.     public function getFinanceurs(): Collection
  732.     {
  733.         return $this->financeurs;
  734.     }
  735.     public function addFinanceur(Financeur $financeur): self
  736.     {
  737.         if (!$this->financeurs->contains($financeur)) {
  738.             $this->financeurs->add($financeur);
  739.         }
  740.         return $this;
  741.     }
  742.     public function removeFinanceur(Financeur $financeur): self
  743.     {
  744.         $this->financeurs->removeElement($financeur);
  745.         return $this;
  746.     }
  747.     public function getBanniere(): ?Upload
  748.     {
  749.         return $this->banniere;
  750.     }
  751.     public function setBanniere(?Upload $banniere): self
  752.     {
  753.         $this->banniere $banniere;
  754.         return $this;
  755.     }
  756.     public function getVignette(): ?Upload
  757.     {
  758.         return $this->vignette;
  759.     }
  760.     public function setVignette(?Upload $vignette): self
  761.     {
  762.         $this->vignette $vignette;
  763.         return $this;
  764.     }
  765.     public function isPublie(): ?bool
  766.     {
  767.         return $this->publie;
  768.     }
  769.     public function isCertifiantes(): ?bool
  770.     {
  771.         return $this->certifiantes;
  772.     }
  773.     public function getTauxObtention(): ?string
  774.     {
  775.         return $this->tauxObtention;
  776.     }
  777.     public function setTauxObtention(?string $tauxObtention): self
  778.     {
  779.         $this->tauxObtention $tauxObtention;
  780.         return $this;
  781.     }
  782.     public function getTauxAbandon(): ?string
  783.     {
  784.         return $this->tauxAbandon;
  785.     }
  786.     public function setTauxAbandon(?string $tauxAbandon): self
  787.     {
  788.         $this->tauxAbandon $tauxAbandon;
  789.         return $this;
  790.     }
  791.     public function getTauxSatisfaction(): ?string
  792.     {
  793.         return $this->tauxSatisfaction;
  794.     }
  795.     public function setTauxSatisfaction(?string $tauxSatisfaction): self
  796.     {
  797.         $this->tauxSatisfaction $tauxSatisfaction;
  798.         return $this;
  799.     }
  800.     public function getTauxPourSuiteEtude(): ?string
  801.     {
  802.         return $this->tauxPourSuiteEtude;
  803.     }
  804.     public function setTauxPourSuiteEtude(?string $tauxPourSuiteEtude): self
  805.     {
  806.         $this->tauxPourSuiteEtude $tauxPourSuiteEtude;
  807.         return $this;
  808.     }
  809.     public function getTauxEmployabilite(): ?string
  810.     {
  811.         return $this->tauxEmployabilite;
  812.     }
  813.     public function setTauxEmployabilite(?string $tauxEmployabilite): self
  814.     {
  815.         $this->tauxEmployabilite $tauxEmployabilite;
  816.         return $this;
  817.     }
  818.     public function getSalaireMoyen(): ?string
  819.     {
  820.         return $this->salaireMoyen;
  821.     }
  822.     public function setSalaireMoyen(?string $salaireMoyen): self
  823.     {
  824.         $this->salaireMoyen $salaireMoyen;
  825.         return $this;
  826.     }
  827.     public function getNiveaumateriel(): ?Masterlistelg
  828.     {
  829.         return $this->niveaumateriel;
  830.     }
  831.     public function setNiveaumateriel(?Masterlistelg $niveaumateriel): self
  832.     {
  833.         $this->niveaumateriel $niveaumateriel;
  834.         return $this;
  835.     }
  836.     public function getNiveautechnique(): ?Masterlistelg
  837.     {
  838.         return $this->niveautechnique;
  839.     }
  840.     public function setNiveautechnique(?Masterlistelg $niveautechnique): self
  841.     {
  842.         $this->niveautechnique $niveautechnique;
  843.         return $this;
  844.     }
  845.     public function getAutoriteDelivranceCpf(): ?Masterlistelg
  846.     {
  847.         return $this->autoriteDelivranceCpf;
  848.     }
  849.     public function setAutoriteDelivranceCpf(?Masterlistelg $autoriteDelivranceCpf): self
  850.     {
  851.         $this->autoriteDelivranceCpf $autoriteDelivranceCpf;
  852.         return $this;
  853.     }
  854.     /**
  855.      * @return Collection<int, ModuleModaliteEvaluationFinale>
  856.      */
  857.     public function getModuleModaliteEvaluationFinales(): Collection
  858.     {
  859.         return $this->moduleModaliteEvaluationFinales;
  860.     }
  861.     public function setModuleModaliteEvaluationFinales(Collection $modulemodaliteevaluationfinales): self
  862.     {
  863.         $this->moduleModaliteEvaluationFinales $modulemodaliteevaluationfinales;
  864.         return $this;
  865.     }
  866.     public function addModuleModaliteEvaluationFinales(ModuleModaliteEvaluationFinale $moduleModaliteEvaluationFinale): self
  867.     {
  868.         if (!$this->moduleModaliteEvaluationFinales->contains($moduleModaliteEvaluationFinale)) {
  869.             $this->moduleModaliteEvaluationFinales->add($moduleModaliteEvaluationFinale);
  870.             $moduleModaliteEvaluationFinale->setModule($this);
  871.         }
  872.         return $this;
  873.     }
  874.     public function removeModuleModaliteEvaluationFinales(ModuleModaliteEvaluationFinale $moduleModaliteEvaluationFinale): self
  875.     {
  876.         // set the owning side to null (unless already changed)
  877.         if ($this->moduleModaliteEvaluationFinales->removeElement($moduleModaliteEvaluationFinale) && $moduleModaliteEvaluationFinale->getModule() === $this) {
  878.             $moduleModaliteEvaluationFinale->setModule(null);
  879.         }
  880.         return $this;
  881.     }
  882.     public function getNbrsessioninter(): ?int
  883.     {
  884.         return $this->nbrsessioninter;
  885.     }
  886.     public function setNbrsessioninter(?int $nbrsessioninter): self
  887.     {
  888.         $this->nbrsessioninter $nbrsessioninter;
  889.         return $this;
  890.     }
  891.     public function getNbrsessionintra(): ?int
  892.     {
  893.         return $this->nbrsessionintra;
  894.     }
  895.     public function setNbrsessionintra(?int $nbrsessionintra): self
  896.     {
  897.         $this->nbrsessionintra $nbrsessionintra;
  898.         return $this;
  899.     }
  900.     public function getIsDefault(): ?bool
  901.     {
  902.         return $this->isDefault;
  903.     }
  904.     public function setIsDefault(?bool $isDefault): self
  905.     {
  906.         $this->isDefault $isDefault;
  907.         return $this;
  908.     }
  909.     public function isIsDefault(): ?bool
  910.     {
  911.         return $this->isDefault;
  912.     }
  913.     public function addModulemodaliteevaluationfinale(ModuleModaliteEvaluationFinale $modulemodaliteevaluationfinale): self
  914.     {
  915.         if (!$this->moduleModaliteEvaluationFinales->contains($modulemodaliteevaluationfinale)) {
  916.             $this->moduleModaliteEvaluationFinales->add($modulemodaliteevaluationfinale);
  917.             $modulemodaliteevaluationfinale->setModule($this);
  918.         }
  919.         return $this;
  920.     }
  921.     public function removeModulemodaliteevaluationfinale(ModuleModaliteEvaluationFinale $modulemodaliteevaluationfinale): self
  922.     {
  923.         // set the owning side to null (unless already changed)
  924.         if ($this->moduleModaliteEvaluationFinales->removeElement($modulemodaliteevaluationfinale) && $modulemodaliteevaluationfinale->getModule() === $this) {
  925.             $modulemodaliteevaluationfinale->setModule(null);
  926.         }
  927.         return $this;
  928.     }
  929.     /**
  930.      * @return Collection<int, FormateurModule>
  931.      */
  932.     public function getFormateurModules(): Collection
  933.     {
  934.         return $this->formateurModules;
  935.     }
  936.     public function addFormateurModule(FormateurModule $formateurModule): self
  937.     {
  938.         if (!$this->formateurModules->contains($formateurModule)) {
  939.             $this->formateurModules->add($formateurModule);
  940.             $formateurModule->setModule($this);
  941.         }
  942.         return $this;
  943.     }
  944.     public function removeFormateurModule(FormateurModule $formateurModule): self
  945.     {
  946.         // set the owning side to null (unless already changed)
  947.         if ($this->formateurModules->removeElement($formateurModule) && $formateurModule->getModule() === $this) {
  948.             $formateurModule->setModule(null);
  949.         }
  950.         return $this;
  951.     }
  952.     public function addTarifsVente(TarifVenteTheme $tarifsVente): self
  953.     {
  954.         if (!$this->tarifsVentes->contains($tarifsVente)) {
  955.             $this->tarifsVentes->add($tarifsVente);
  956.             $tarifsVente->setModule($this);
  957.         }
  958.         return $this;
  959.     }
  960.     public function removeTarifsVente(TarifVenteTheme $tarifsVente): self
  961.     {
  962.         // set the owning side to null (unless already changed)
  963.         if ($this->tarifsVentes->removeElement($tarifsVente) && $tarifsVente->getModule() === $this) {
  964.             $tarifsVente->setModule(null);
  965.         }
  966.         return $this;
  967.     }
  968.     public function addTarifsVenteIntra(TarifVenteThemeIntra $tarifsVenteIntra): self
  969.     {
  970.         if (!$this->tarifsVenteIntras->contains($tarifsVenteIntra)) {
  971.             $this->tarifsVenteIntras->add($tarifsVenteIntra);
  972.             $tarifsVenteIntra->setModule($this);
  973.         }
  974.         return $this;
  975.     }
  976.     public function removeTarifsVenteIntra(TarifVenteThemeIntra $tarifsVenteIntra): self
  977.     {
  978.         // set the owning side to null (unless already changed)
  979.         if ($this->tarifsVenteIntras->removeElement($tarifsVenteIntra) && $tarifsVenteIntra->getModule() === $this) {
  980.             $tarifsVenteIntra->setModule(null);
  981.         }
  982.         return $this;
  983.     }
  984.     public function getApiGestiform(): ?ApiGestiform
  985.     {
  986.         return $this->apiGestiform;
  987.     }
  988.     public function setApiGestiform(?ApiGestiform $apiGestiform): self
  989.     {
  990.         $this->apiGestiform $apiGestiform;
  991.         return $this;
  992.     }
  993.     public function getTarifVenteInterValeurActuel($valeur null): float|int|null
  994.     {
  995.         $tarifActuel $this->getTarifVenteActuel();
  996.         if (!$tarifActuel) {
  997.             return null
  998.         }
  999.         $isJour $tarifActuel->isTarifJour() ?? false;
  1000.         // Compute base hours/days from module duration when not provided
  1001.         $totalMinutes = (int) max(0, (int) ($this->duree ?? 0));
  1002.         $hours $valeur === null ? ($totalMinutes 60) : (float) $valeur;
  1003.         // Days rounded to nearest integer, half-up, as requested
  1004.         $daysRounded = (int) round(($totalMinutes 60) / 70PHP_ROUND_HALF_UP);
  1005.         // Select the comparison value depending on tariff type
  1006.         $compareValue $isJour $daysRounded $hours;
  1007.         $matched null;
  1008.         foreach ($tarifActuel->getLignes() as $ligne) {
  1009.             $min $ligne->getValeurMin();
  1010.             $max $ligne->getValeurMax();
  1011.             $inLower = ($min === null) || ($compareValue >= $min);
  1012.             $inUpper = ($max === null) || ($compareValue <= $max);
  1013.             if ($inLower && $inUpper) {
  1014.                 $matched $ligne;
  1015.                 break;
  1016.             }
  1017.         }
  1018.         // Fallback: if none matched, choose the line with the smallest non-null min greater than compareValue,
  1019.         // otherwise the one with the smallest min overall.
  1020.         if ($matched === null) {
  1021.             $candidates $tarifActuel->getLignes()->toArray();
  1022.             usort($candidates, function ($a$b) {
  1023.                 $amin $a->getValeurMin(); $bmin $b->getValeurMin();
  1024.                 if ($amin === $bmin) { return 0; }
  1025.                 if ($amin === null) { return -1; }
  1026.                 if ($bmin === null) { return 1; }
  1027.                 return $amin <=> $bmin;
  1028.             });
  1029.             foreach ($candidates as $cand) {
  1030.                 if ($cand->getValeurMin() !== null && $compareValue <= $cand->getValeurMax() ?: PHP_INT_MAX) {
  1031.                     $matched $cand; break;
  1032.                 }
  1033.             }
  1034.             if ($matched === null && count($candidates) > 0) {
  1035.                 $matched $candidates[0];
  1036.             }
  1037.         }
  1038.         if ($matched !== null && $matched->getTarif() !== null) {
  1039.             $qty $isJour $daysRounded $hours;
  1040.             return (float) $matched->getTarif() * $qty;
  1041.         }
  1042.         return null;
  1043.     }
  1044.         public function getTarifVenteActuel($datedujour null): ?TarifVenteTheme
  1045.         {
  1046.             if (is_null($datedujour)) {
  1047.                 $datedujour = new DateTime();
  1048.             }
  1049.             $datedujour->setTime(00);
  1050.             if ($this->getTarifsVentes()) {
  1051.                 foreach ($this->getTarifsVentes() as $tarif) {
  1052.                     if ($tarif->getStart() <= $datedujour && ($tarif->getEnd() >= $datedujour || is_null($tarif->getEnd()))) {
  1053.                         return $tarif;
  1054.                     }
  1055.                 }
  1056.             }
  1057.             return $this->getThemeTarif()?->getTarifVenteActuel()
  1058.                 ?? $this->getSousThemeTheme()?->getTheme()?->getTarifVenteActuel()
  1059.                 ?? null;
  1060.         }
  1061.     /**
  1062.      * @return Collection<int, TarifVenteTheme>
  1063.      */
  1064.     public function getTarifsVentes(): Collection
  1065.     {
  1066.         return $this->tarifsVentes;
  1067.     }
  1068.     public function getThemeTarif(): ?Theme
  1069.     {
  1070.         return $this->themeTarif;
  1071.     }
  1072.     public function setThemeTarif(?Theme $themeTarif): self
  1073.     {
  1074.         $this->themeTarif $themeTarif;
  1075.         return $this;
  1076.     }
  1077.     public function getSousThemeTheme(): ?SousThemeTheme
  1078.     {
  1079.         return $this->sousThemeTheme;
  1080.     }
  1081.     public function setSousThemeTheme(?SousThemeTheme $sousThemeTheme): self
  1082.     {
  1083.         $this->sousThemeTheme $sousThemeTheme;
  1084.         return $this;
  1085.     }
  1086.     public function getOrigineTarifInter(): int
  1087.     {
  1088.         $tarifactuel $this->getTarifVenteActuel();
  1089.         /*
  1090.         if(is_null($tarifactuel)){
  1091.             echo($this->getId());
  1092.         die(' fin ');
  1093.         }
  1094.         */
  1095.         if (!is_null($tarifactuel)) {
  1096.             if (!is_null($tarifactuel->getModule())) {
  1097.                 return 3;
  1098.             }
  1099.             if (!is_null($tarifactuel->getTheme())) {
  1100.                 return 2;
  1101.             }
  1102.             if (is_null($tarifactuel->getTarifDefaut())) {
  1103.                 return 1;
  1104.             }
  1105.         }
  1106.         return 0;
  1107.     }
  1108.     public function getOrigineTarifIntra(): int
  1109.     {
  1110.         $tarifactuel $this->getTarifVenteIntraActuel();
  1111.         if (!is_null($tarifactuel->getModule())) {
  1112.             return 3;
  1113.         }
  1114.         if (!is_null($tarifactuel->getTheme())) {
  1115.             return 2;
  1116.         }
  1117.         if (is_null($tarifactuel->getTarifDefaut())) {
  1118.             return 1;
  1119.         }
  1120.         return 0;
  1121.     }
  1122.     // 0 -> ne sait pas
  1123.     // 1 -> tarif défaut
  1124.     // 2 -> thème
  1125.     // 3 -> module
  1126.     public function getTarifVenteIntraActuel($datedujour null)
  1127.     {
  1128.         if (is_null($datedujour)) {
  1129.             $datedujour = new DateTime();
  1130.             $datedujour->setTime(00);
  1131.         }
  1132.         $datedujour->setTime(00);
  1133.         // retourne le tarif spécifique au module
  1134.         foreach ($this->getTarifsVenteIntras() as $tarif) {
  1135.             if ($tarif->getStart() <= $datedujour && ($tarif->getEnd() >= $datedujour || is_null($tarif->getEnd()))) {
  1136.                 return $tarif;
  1137.             }
  1138.         }
  1139.         // retourne le tarif du thème
  1140.         if (!is_null($this->getThemeTarif())) {
  1141.             return $this->getThemeTarif()->getTarifVenteIntraActuel();
  1142.         }
  1143.         // n'a trouvé aucun tarif
  1144.         return null;
  1145.     }
  1146.     // 0 -> ne sait pas
  1147.     // 1 -> tarif défaut
  1148.     // 2 -> thème
  1149.     // 3 -> module
  1150.     /**
  1151.      * @return Collection<int, TarifVenteThemeIntra>
  1152.      */
  1153.     public function getTarifsVenteIntras(): Collection
  1154.     {
  1155.         return $this->tarifsVenteIntras;
  1156.     }
  1157.     public function getTarifVenteIntraOfActuelJour($jour null): float|int|null
  1158.     {
  1159.         if ($jour == null) {
  1160.             // duree is stored in minutes; convert to days (hours/7)
  1161.             $jour = (($this->duree ?? 0) / 60) / 7;
  1162.         }
  1163.         $tarifIntra $this->getTarifVenteIntraActuel();
  1164.         if ($tarifIntra instanceof \App\Entity\Gestiform\Admin\Tarifs\TarifVenteThemeIntra) {
  1165.             foreach ($tarifIntra->getIntraJourOfs() as $ligne) {
  1166.                 if ($ligne->getJour() == $jour) {
  1167.                     return $ligne->getTarif() * $ligne->getJour();
  1168.                 }
  1169.             }
  1170.         }
  1171.         return null;
  1172.     }
  1173.     public function getTarifVenteIntraClientActuelJour($jour null)
  1174.     {
  1175.         if ($jour == null) {
  1176.             // duree is stored in minutes; convert to days (hours/7)
  1177.             $jour = (($this->duree ?? 0) / 60) / 7;
  1178.         }
  1179.         $tarifIntra $this->getTarifVenteIntraActuel();
  1180.         if ($tarifIntra instanceof \App\Entity\Gestiform\Admin\Tarifs\TarifVenteThemeIntra) {
  1181.             foreach ($tarifIntra->getIntraJourClients() as $ligne) {
  1182.                 if ($ligne->getJour() == $jour) {
  1183.                     return $ligne->getTarif() * $ligne->getJour();
  1184.                 }
  1185.             }
  1186.         }
  1187.         return null;
  1188.     }
  1189.     public function getEvents(): Collection
  1190.     {
  1191.         return $this->events;
  1192.     }
  1193.     public function addEvent(Event $event): self
  1194.     {
  1195.         if (!$this->events->contains($event)) {
  1196.             $this->events->add($event);
  1197.             $event->setModule($this);
  1198.         }
  1199.         return $this;
  1200.     }
  1201.     public function removeEvent(Event $event): self
  1202.     {
  1203.         // set the owning side to null (unless already changed)
  1204.         if ($this->events->removeElement($event) && $event->getModule() === $this) {
  1205.             $event->setModule(null);
  1206.         }
  1207.         return $this;
  1208.     }
  1209.     /**
  1210.      * @return Collection<int, Certification>
  1211.      */
  1212.     public function getCertifications(): Collection
  1213.     {
  1214.         return $this->certifications;
  1215.     }
  1216.     public function setCertifications(Collection $certifications): self
  1217.     {
  1218.         $this->certifications $certifications;
  1219.         return $this;
  1220.     }
  1221.     public function addCertification(Certification $certification): self
  1222.     {
  1223.         if (!$this->certifications->contains($certification)) {
  1224.             $this->certifications->add($certification);
  1225.         }
  1226.         return $this;
  1227.     }
  1228.     public function removeCertification(Certification $certification): self
  1229.     {
  1230.         $this->certifications->removeElement($certification);
  1231.         return $this;
  1232.     }
  1233.     public function getFullIntituleType(): string
  1234.     {
  1235.         $type $this instanceof Certification 'certification' 'module';
  1236.         return $this->intitule ' (' $type ')';
  1237.     }
  1238.     public function getType(): string
  1239.     {
  1240.      return $this instanceof Certification 'certification' 'module';
  1241.     }
  1242.     /**
  1243.      * @return Collection<int, Document>
  1244.      */
  1245.     public function getDocuments(): Collection
  1246.     {
  1247.         return $this->documents;
  1248.     }
  1249.     public function addDocument(Document $document): self
  1250.     {
  1251.         if (!$this->documents->contains($document)) {
  1252.             $this->documents->add($document);
  1253.             $document->setModule($this);
  1254.         }
  1255.         return $this;
  1256.     }
  1257.     public function removeDocument(Document $document): self
  1258.     {
  1259.         // set the owning side to null (unless already changed)
  1260.         if ($this->documents->removeElement($document) && $document->getModule() === $this) {
  1261.             $document->setModule(null);
  1262.         }
  1263.         return $this;
  1264.     }
  1265. }