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

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