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

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