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