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