src/Entity/Gestiform/Formations/Catalogue/Module/Module.php line 36
<?phpnamespace App\Entity\Gestiform\Formations\Catalogue\Module;use App\Entity\AbstractEntity;use App\Entity\Common\Document;use App\Entity\Common\Upload;use App\Entity\Gestiform\Admin\ApiGestiform;use App\Entity\Gestiform\Admin\MasterListe\Masterlistelg;use App\Entity\Gestiform\Admin\Societe;use App\Entity\Gestiform\Admin\Tarifs\TarifVenteTheme;use App\Entity\Gestiform\Admin\Tarifs\TarifVenteThemeIntra;use App\Entity\Gestiform\Formations\Catalogue\Certification;use App\Entity\Gestiform\Formations\Catalogue\Parcours\Bloc\BlocModule;use App\Entity\Gestiform\Formations\Catalogue\Theme\SousThemeTheme;use App\Entity\Gestiform\Formations\Catalogue\Theme\Theme;use App\Entity\Gestiform\Formations\Financeur\Financeur;use App\Entity\Gestiform\Formations\Formateur\FormateurModule;use App\Entity\Gestiform\Formations\Session\Planning\Event;use App\Entity\Trait\ApiGestiformEntity;use App\Repository\Gestiform\Formations\Catalogue\Module\ModuleRepository;use DateTime;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: ModuleRepository::class)]#[ORM\InheritanceType('JOINED')]#[ORM\DiscriminatorColumn(name: 'type', type: 'string')]#[ORM\DiscriminatorMap(['module' => 'Module', 'certification' => Certification::class])]class Module extends AbstractEntity{use ApiGestiformEntity;#[ORM\Column(type: 'string', length: 255, nullable: false)]private string $intitule;#[ORM\Column(type: 'integer', nullable: true)]private ?int $duree = null;#[ORM\Column(type: 'boolean', nullable: true)]private ?bool $publie = false;#[ORM\Column(type: 'boolean', nullable: true)]private ?bool $cpf = false;#[ORM\Column(type: 'boolean', nullable: true)]private ?bool $certifiantes = false;#[ORM\Column(type: 'boolean')]private bool $isDefault = false;#[ORM\Column(type: 'boolean', nullable: true)]private bool $certifiante = false;#[ORM\Column(type: 'string', length: 255, nullable: true)]private ?string $code = null;#[ORM\Column(type: 'text', nullable: true)]private ?string $modalitepedagogiques = null;#[ORM\Column(type: 'text', nullable: true)]private ?string $statistiques = null;#[ORM\Column(type: 'text', nullable: true)]private ?string $modaliteevaluationinitial = null;#[ORM\Column(type: 'text', nullable: true)]private ?string $modaliteevaluationfinal = null;#[ORM\Column(type: 'string', length: 255, nullable: true)]private ?string $path = null;#[ORM\Column(type: 'string', length: 255, nullable: true)]private ?string $codeCpf = null;#[ORM\Column(type: 'string', length: 255, nullable: true)]private ?string $codeCpfSalarie = null;#[ORM\Column(type: 'string', length: 255, nullable: true)]private ?string $codeCpfDemandeurEmploi = null;#[ORM\Column(type: 'decimal', precision: 10, scale: 0, nullable: true)]private ?float $tarifInterJour = null;#[ORM\Column(type: 'decimal', precision: 10, scale: 0, nullable: true)]private ?float $tarifInterHoraire = null;#[ORM\Column(type: 'decimal', precision: 10, scale: 0, nullable: true)]private ?float $tarifIntraJour = null;#[ORM\Column(type: 'decimal', precision: 10, scale: 0, nullable: true)]private ?float $tarifIntraHoraire = null;#[ORM\Column(type: 'decimal', precision: 10, scale: 0, nullable: true)]private ?float $tarifJury = null;#[ORM\Column(type: 'decimal', precision: 10, scale: 0, nullable: true)]private ?float $tarifJury2 = null;#[ORM\Column(type: 'boolean', nullable: true)]private ?bool $tarifJuryTtc = null;#[ORM\Column(type: 'text', nullable: true)]private ?string $prerequis = null;#[ORM\Column(type: 'text', nullable: true)]private ?string $objectif = null;#[ORM\Column(type: 'text', nullable: true)]private ?string $plus = null;#[ORM\Column(type: 'text', nullable: true)]private ?string $public = null;#[ORM\Column(type: 'string', length: 255, nullable: true)]private ?string $commentaire = null;#[ORM\Column(type: 'text', nullable: true)]private ?string $certificationCommentaire = null;#[ORM\Column(type: 'string', length: 255, nullable: true)]private ?string $seoTitre = null;#[ORM\Column(type: 'string', length: 255, nullable: true)]private ?string $seoDescription = null;#[ORM\Column(type: 'text', nullable: true)]private ?string $infoPratique = null;#[ORM\Column(type: 'text', nullable: true)]#[Assert\NotBlank(message: 'Ce champ est obligatoire.', groups: ['module'])]private ?string $accessibiliteHandicap = null;#[ORM\Column(type: 'string', length: 255, nullable: true)]private ?string $altVignette = null;#[ORM\Column(type: 'text', nullable: true)]private ?string $description = null;#[ORM\Column(type: 'text', nullable: true)]private ?string $modalitesDelaisAcces = null;#[ORM\Column(type: 'string', length: 255, nullable: true)]private ?string $altBanniere = null;#[ORM\Column(type: 'string', length: 255, nullable: true)]private ?string $identifiantDokelio = null;#[ORM\Column(type: 'boolean', nullable: true)]private ?bool $publication = false;#[ORM\Column(type: 'text', nullable: true)]private ?string $contenuApres = null;#[ORM\Column(type: 'text', nullable: true)]private ?string $contenuAvant = null;#[ORM\Column(name: 'tauxObtention', type: 'text', nullable: true)]private ?string $tauxObtention = null;#[ORM\Column(name: 'tauxAbandon', type: 'text', nullable: true)]private ?string $tauxAbandon = null;#[ORM\Column(name: 'tauxSatisfaction', type: 'text', nullable: true)]private ?string $tauxSatisfaction = null;#[ORM\Column(name: 'tauxPourSuiteEtude', type: 'text', nullable: true)]private ?string $tauxPourSuiteEtude = null;#[ORM\Column(name: 'tauxEmployabilite', type: 'text', nullable: true)]private ?string $tauxEmployabilite = null;#[ORM\Column(name: 'salaireMoyen', type: 'text', nullable: true)]private ?string $salaireMoyen = null;#[ORM\Column(type: 'integer', nullable: true)]private ?int $nbrsessioninter = null;#[ORM\Column(type: 'integer', nullable: true)]private ?int $nbrsessionintra = null;#[ORM\OneToMany(mappedBy: 'module', targetEntity: Event::class)]private Collection $events;#[ORM\OneToMany(mappedBy: 'module', targetEntity: BlocModule::class, cascade: ['persist'])]private Collection $blocModules;#[ORM\OneToMany(mappedBy: 'module', targetEntity: Chapitre::class, cascade: ['persist'])]private Collection $chapitres;#[ORM\JoinColumn(nullable: true)]#[ORM\ManyToOne(targetEntity: Masterlistelg::class)]private ?Masterlistelg $modeFormation = null;#[ORM\Column(type: 'json', nullable: true)]private ?array $modesFormation = null;#[ORM\JoinColumn(nullable: true)]#[ORM\ManyToOne(targetEntity: SousThemeTheme::class, inversedBy: 'modules')]private ?SousThemeTheme $sousThemeTheme = null;#[ORM\ManyToOne(targetEntity: Theme::class)]private ?Theme $themeTarif = null;#[ORM\JoinTable(name: 'module_exige_avant')]#[ORM\ManyToMany(targetEntity: Module::class)]private Collection $modulesExigeAvant;#[ORM\JoinTable(name: 'module_souhaitable_avant')]#[ORM\ManyToMany(targetEntity: Module::class)]private Collection $modulesSouhaitableAvant;#[ORM\JoinTable(name: 'module_conseille_apres')]#[ORM\ManyToMany(targetEntity: Module::class)]private Collection $modulesConseilleApres;#[ORM\OneToMany(mappedBy: 'module', targetEntity: ModuleCompetence::class, cascade: ['persist'])]private Collection $moduleCompetences;#[ORM\ManyToMany(targetEntity: Financeur::class, inversedBy: 'modules', cascade: ['persist'])]private Collection $financeurs;#[ORM\ManyToOne(targetEntity: Masterlistelg::class)]private ?Masterlistelg $niveaumateriel = null;#[ORM\ManyToOne(targetEntity: Masterlistelg::class)]private ?Masterlistelg $niveautechnique = null;#[ORM\ManyToOne(targetEntity: Masterlistelg::class)]private ?Masterlistelg $autoriteDelivranceCpf = null;#[ORM\JoinColumn(nullable: true)]#[ORM\OneToMany(mappedBy: 'module', targetEntity: ModuleModaliteEvaluationFinale::class, cascade: ['persist'])]private Collection $moduleModaliteEvaluationFinales;#[ORM\JoinColumn(nullable: true)]#[ORM\ManyToOne(targetEntity: Upload::class, cascade: ['persist', 'remove'])]private ?Upload $banniere = null;#[ORM\JoinColumn(nullable: true)]#[ORM\ManyToOne(targetEntity: Upload::class, cascade: ['persist', 'remove'])]private ?Upload $vignette = null;#[ORM\OneToMany(mappedBy: 'module', targetEntity: FormateurModule::class)]private Collection $formateurModules;#[ORM\OneToMany(mappedBy: 'module', targetEntity: TarifVenteTheme::class, cascade: ['persist', 'remove'])]private Collection $tarifsVentes;#[ORM\OneToMany(mappedBy: 'module', targetEntity: TarifVenteThemeIntra::class, cascade: ['persist', 'remove'])]private Collection $tarifsVenteIntras;#[ORM\ManyToMany(targetEntity: Certification::class, inversedBy: 'modules', cascade: ['persist'])]private Collection $certifications;#[ORM\OneToMany(mappedBy: 'module', targetEntity: Document::class, cascade: ['persist'])]private Collection $documents;public function __construct(){$this->certifications = new ArrayCollection();$this->blocModules = new ArrayCollection();$this->chapitres = new ArrayCollection();$this->modulesExigeAvant = new ArrayCollection();$this->modulesSouhaitableAvant = new ArrayCollection();$this->modulesConseilleApres = new ArrayCollection();$this->moduleCompetences = new ArrayCollection();$this->financeurs = new ArrayCollection();$this->moduleModaliteEvaluationFinales = new ArrayCollection();$this->formateurModules = new ArrayCollection();$this->tarifsVentes = new ArrayCollection();$this->tarifsVenteIntras = new ArrayCollection();$this->events = new ArrayCollection();$this->documents = new ArrayCollection();}public function getIntitule(): ?string{return $this->intitule;}public function setIntitule(string $intitule): self{$this->intitule = $intitule;return $this;}public function getTarifJury2(): ?float{return $this->tarifJury2;}public function setTarifJury2(?float $tarifJury2): self{$this->tarifJury2 = $tarifJury2;return $this;}public function isTarifJuryTtc(): ?bool{return $this->tarifJuryTtc;}public function setTarifJuryTtc(?bool $tarifJuryTtc): self{$this->tarifJuryTtc = $tarifJuryTtc;return $this;}/*** Helper to access the default company without exposing ApiGestiform upstream.*/public function tSocieteParDefaut(): ?Societe{return $this->getApiGestiform()?->getSocieteParDefaut();}public function getDuree(): ?int{return $this->duree;}public function setDuree(?int $duree): self{$this->duree = $duree;return $this;}public function getModesFormation(): array{return $this->modesFormation ?? [];}public function setModesFormation(?array $modesFormation): self{$this->modesFormation = $modesFormation;return $this;}public function isCertifiante(): ?bool{return $this->certifiante;}public function setCertifiante(?bool $certifiante): self{$this->certifiante = $certifiante;return $this;}public function getCode(): ?string{return $this->code;}public function setCode(?string $code): self{$this->code = $code;return $this;}public function getPath(): ?string{return $this->path;}public function setPath(?string $path): self{$this->path = $path;return $this;}public function isCpf(): ?bool{return $this->cpf;}public function setCpf(?bool $cpf): self{$this->cpf = $cpf;return $this;}public function getPublie(): ?bool{return $this->publie;}public function setPublie(?bool $publie): self{$this->publie = $publie;return $this;}public function getCertifiantes(): ?bool{return $this->certifiantes;}public function setCertifiantes(?bool $certifiantes): self{$this->certifiantes = $certifiantes;return $this;}public function getCodeCpf(): ?string{return $this->codeCpf;}public function setCodeCpf(?string $codeCpf): self{$this->codeCpf = $codeCpf;return $this;}public function getCodeCpfSalarie(): ?string{return $this->codeCpfSalarie;}public function setCodeCpfSalarie(?string $codeCpfSalarie): self{$this->codeCpfSalarie = $codeCpfSalarie;return $this;}public function getCodeCpfDemandeurEmploi(): ?string{return $this->codeCpfDemandeurEmploi;}public function setCodeCpfDemandeurEmploi(?string $codeCpfDemandeurEmploi): self{$this->codeCpfDemandeurEmploi = $codeCpfDemandeurEmploi;return $this;}public function getTarifInterJour(): ?string{return $this->tarifInterJour;}public function setTarifInterJour(?string $tarifInterJour): self{$this->tarifInterJour = $tarifInterJour;return $this;}public function getTarifInterHoraire(): ?string{return $this->tarifInterHoraire;}public function setTarifInterHoraire(?string $tarifInterHoraire): self{$this->tarifInterHoraire = $tarifInterHoraire;return $this;}public function getTarifIntraJour(): ?string{return $this->tarifIntraJour;}public function setTarifIntraJour(?string $tarifIntraJour): self{$this->tarifIntraJour = $tarifIntraJour;return $this;}public function getTarifIntraHoraire(): ?string{return $this->tarifIntraHoraire;}public function setTarifIntraHoraire(?string $tarifIntraHoraire): self{$this->tarifIntraHoraire = $tarifIntraHoraire;return $this;}public function getTarifJury(): ?float{return $this->tarifJury;}public function setTarifJury(?float $tarifJury): self{$this->tarifJury = $tarifJury;return $this;}public function getPrerequis(): ?string{return $this->prerequis;}public function setPrerequis(?string $prerequis): self{$this->prerequis = $prerequis;return $this;}public function getObjectif(): ?string{return $this->objectif;}public function setObjectif(?string $objectif): self{$this->objectif = $objectif;return $this;}public function getPlus(): ?string{return $this->plus;}public function setPlus(?string $plus): self{$this->plus = $plus;return $this;}public function getPublic(): ?string{return $this->public;}public function setPublic(?string $public): self{$this->public = $public;return $this;}public function getCommentaire(): ?string{return $this->commentaire;}public function setCommentaire(?string $commentaire): self{$this->commentaire = $commentaire;return $this;}public function getCertificationCommentaire(): ?string{return $this->certificationCommentaire;}public function setCertificationCommentaire(?string $certificationCommentaire): self{$this->certificationCommentaire = $certificationCommentaire;return $this;}public function getSeoTitre(): ?string{return $this->seoTitre;}public function setSeoTitre(?string $seoTitre): self{$this->seoTitre = $seoTitre;return $this;}public function getSeoDescription(): ?string{return $this->seoDescription;}public function setSeoDescription(?string $seoDescription): self{$this->seoDescription = $seoDescription;return $this;}public function getInfoPratique(): ?string{return $this->infoPratique;}public function setInfoPratique(?string $infoPratique): self{$this->infoPratique = $infoPratique;return $this;}public function getAccessibiliteHandicap(): ?string{return $this->accessibiliteHandicap;}public function setAccessibiliteHandicap(?string $accessibiliteHandicap): self{$this->accessibiliteHandicap = $accessibiliteHandicap;return $this;}public function getAltVignette(): ?string{return $this->altVignette;}public function setAltVignette(?string $altVignette): self{$this->altVignette = $altVignette;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): self{$this->description = $description;return $this;}public function getModalitesDelaisAcces(): ?string{return $this->modalitesDelaisAcces;}public function setModalitesDelaisAcces(?string $modalitesDelaisAcces): self{$this->modalitesDelaisAcces = $modalitesDelaisAcces;return $this;}public function getAltBanniere(): ?string{return $this->altBanniere;}public function setAltBanniere(?string $altBanniere): self{$this->altBanniere = $altBanniere;return $this;}public function getIdentifiantDokelio(): ?string{return $this->identifiantDokelio;}public function setIdentifiantDokelio(?string $identifiantDokelio): self{$this->identifiantDokelio = $identifiantDokelio;return $this;}public function isPublication(): ?bool{return $this->publication;}public function setPublication(?bool $publication): self{$this->publication = $publication;return $this;}public function getContenuApres(): ?string{return $this->contenuApres;}public function setContenuApres(?string $contenuApres): self{$this->contenuApres = $contenuApres;return $this;}public function getModalitepedagogiques(): ?string{return $this->modalitepedagogiques;}public function setModalitepedagogiques(?string $modalitepedagogiques): self{$this->modalitepedagogiques = $modalitepedagogiques;return $this;}public function getStatistiques(): ?string{return $this->statistiques;}public function setStatistiques(?string $statistiques): self{$this->statistiques = $statistiques;return $this;}public function getModaliteevaluationinitial(): ?string{return $this->modaliteevaluationinitial;}public function setModaliteevaluationinitial(?string $modaliteevaluationinitial): self{$this->modaliteevaluationinitial = $modaliteevaluationinitial;return $this;}public function getModaliteevaluationfinal(): ?string{return $this->modaliteevaluationfinal;}public function setModaliteevaluationfinal(?string $modaliteevaluationfinal): self{$this->modaliteevaluationfinal = $modaliteevaluationfinal;return $this;}public function getContenuAvant(): ?string{return $this->contenuAvant;}public function setContenuAvant(?string $contenuAvant): self{$this->contenuAvant = $contenuAvant;return $this;}/*** @return Collection<int, BlocModule>*/public function getBlocModules(): Collection{return $this->blocModules;}public function setBlocModules(Collection $blocModules): self{$this->blocModules = $blocModules;return $this;}public function addBlocModule(BlocModule $blocModule): self{if (!$this->blocModules->contains($blocModule)) {$this->blocModules->add($blocModule);$blocModule->setModule($this);}return $this;}public function removeBlocModule(BlocModule $blocModule): self{// set the owning side to null (unless already changed)if ($this->blocModules->removeElement($blocModule) && $blocModule->getModule() === $this) {$blocModule->setModule(null);}return $this;}/*** @return Collection<int, Chapitre>*/public function getChapitres(): Collection{return $this->chapitres;}public function setChapitres(Collection $chapitres): self{$this->chapitres = $chapitres;return $this;}public function addChapitre(Chapitre $chapitre): self{if (!$this->chapitres->contains($chapitre)) {$this->chapitres->add($chapitre);$chapitre->setModule($this);}return $this;}public function removeChapitre(Chapitre $chapitre): self{// set the owning side to null (unless already changed)if ($this->chapitres->removeElement($chapitre) && $chapitre->getModule() === $this) {$chapitre->setModule(null);}return $this;}public function getModeFormation(): ?Masterlistelg{return $this->modeFormation;}public function setModeFormation(?Masterlistelg $modeFormation): self{$this->modeFormation = $modeFormation;return $this;}/*** @return Collection<int, Module>*/public function getModulesExigeAvant(): Collection{return $this->modulesExigeAvant;}public function addModulesExigeAvant(Module $modulesExigeAvant): self{if (!$this->modulesExigeAvant->contains($modulesExigeAvant)) {$this->modulesExigeAvant->add($modulesExigeAvant);}return $this;}public function removeModulesExigeAvant(Module $modulesExigeAvant): self{$this->modulesExigeAvant->removeElement($modulesExigeAvant);return $this;}/*** @return Collection<int, Module>*/public function getModulesSouhaitableAvant(): Collection{return $this->modulesSouhaitableAvant;}public function addModulesSouhaitableAvant(Module $modulesSouhaitableAvant): self{if (!$this->modulesSouhaitableAvant->contains($modulesSouhaitableAvant)) {$this->modulesSouhaitableAvant->add($modulesSouhaitableAvant);}return $this;}public function removeModulesSouhaitableAvant(Module $modulesSouhaitableAvant): self{$this->modulesSouhaitableAvant->removeElement($modulesSouhaitableAvant);return $this;}/*** @return Collection<int, Module>*/public function getModulesConseilleApres(): Collection{return $this->modulesConseilleApres;}public function addModulesConseilleApre(Module $modulesConseilleApre): self{if (!$this->modulesConseilleApres->contains($modulesConseilleApre)) {$this->modulesConseilleApres->add($modulesConseilleApre);}return $this;}public function removeModulesConseilleApre(Module $modulesConseilleApre): self{$this->modulesConseilleApres->removeElement($modulesConseilleApre);return $this;}/*** @return Collection<int, ModuleCompetence>*/public function getModuleCompetences(): Collection{return $this->moduleCompetences;}public function setModuleCompetences(Collection $moduleCompetences): self{$this->moduleCompetences = $moduleCompetences;return $this;}public function addModuleCompetence(ModuleCompetence $moduleCompetence): self{if (!$this->moduleCompetences->contains($moduleCompetence)) {$this->moduleCompetences->add($moduleCompetence);$moduleCompetence->setModule($this);}return $this;}public function removeModuleCompetence(ModuleCompetence $moduleCompetence): self{// set the owning side to null (unless already changed)if ($this->moduleCompetences->removeElement($moduleCompetence) && $moduleCompetence->getModule() === $this) {$moduleCompetence->setModule(null);}return $this;}/*** @return Collection<int, Financeur>*/public function getFinanceurs(): Collection{return $this->financeurs;}public function addFinanceur(Financeur $financeur): self{if (!$this->financeurs->contains($financeur)) {$this->financeurs->add($financeur);}return $this;}public function removeFinanceur(Financeur $financeur): self{$this->financeurs->removeElement($financeur);return $this;}public function getBanniere(): ?Upload{return $this->banniere;}public function setBanniere(?Upload $banniere): self{$this->banniere = $banniere;return $this;}public function getVignette(): ?Upload{return $this->vignette;}public function setVignette(?Upload $vignette): self{$this->vignette = $vignette;return $this;}public function isPublie(): ?bool{return $this->publie;}public function isCertifiantes(): ?bool{return $this->certifiantes;}public function getTauxObtention(): ?string{return $this->tauxObtention;}public function setTauxObtention(?string $tauxObtention): self{$this->tauxObtention = $tauxObtention;return $this;}public function getTauxAbandon(): ?string{return $this->tauxAbandon;}public function setTauxAbandon(?string $tauxAbandon): self{$this->tauxAbandon = $tauxAbandon;return $this;}public function getTauxSatisfaction(): ?string{return $this->tauxSatisfaction;}public function setTauxSatisfaction(?string $tauxSatisfaction): self{$this->tauxSatisfaction = $tauxSatisfaction;return $this;}public function getTauxPourSuiteEtude(): ?string{return $this->tauxPourSuiteEtude;}public function setTauxPourSuiteEtude(?string $tauxPourSuiteEtude): self{$this->tauxPourSuiteEtude = $tauxPourSuiteEtude;return $this;}public function getTauxEmployabilite(): ?string{return $this->tauxEmployabilite;}public function setTauxEmployabilite(?string $tauxEmployabilite): self{$this->tauxEmployabilite = $tauxEmployabilite;return $this;}public function getSalaireMoyen(): ?string{return $this->salaireMoyen;}public function setSalaireMoyen(?string $salaireMoyen): self{$this->salaireMoyen = $salaireMoyen;return $this;}public function getNiveaumateriel(): ?Masterlistelg{return $this->niveaumateriel;}public function setNiveaumateriel(?Masterlistelg $niveaumateriel): self{$this->niveaumateriel = $niveaumateriel;return $this;}public function getNiveautechnique(): ?Masterlistelg{return $this->niveautechnique;}public function setNiveautechnique(?Masterlistelg $niveautechnique): self{$this->niveautechnique = $niveautechnique;return $this;}public function getAutoriteDelivranceCpf(): ?Masterlistelg{return $this->autoriteDelivranceCpf;}public function setAutoriteDelivranceCpf(?Masterlistelg $autoriteDelivranceCpf): self{$this->autoriteDelivranceCpf = $autoriteDelivranceCpf;return $this;}/*** @return Collection<int, ModuleModaliteEvaluationFinale>*/public function getModuleModaliteEvaluationFinales(): Collection{return $this->moduleModaliteEvaluationFinales;}public function setModuleModaliteEvaluationFinales(Collection $modulemodaliteevaluationfinales): self{$this->moduleModaliteEvaluationFinales = $modulemodaliteevaluationfinales;return $this;}public function addModuleModaliteEvaluationFinales(ModuleModaliteEvaluationFinale $moduleModaliteEvaluationFinale): self{if (!$this->moduleModaliteEvaluationFinales->contains($moduleModaliteEvaluationFinale)) {$this->moduleModaliteEvaluationFinales->add($moduleModaliteEvaluationFinale);$moduleModaliteEvaluationFinale->setModule($this);}return $this;}public function removeModuleModaliteEvaluationFinales(ModuleModaliteEvaluationFinale $moduleModaliteEvaluationFinale): self{// set the owning side to null (unless already changed)if ($this->moduleModaliteEvaluationFinales->removeElement($moduleModaliteEvaluationFinale) && $moduleModaliteEvaluationFinale->getModule() === $this) {$moduleModaliteEvaluationFinale->setModule(null);}return $this;}public function getNbrsessioninter(): ?int{return $this->nbrsessioninter;}public function setNbrsessioninter(?int $nbrsessioninter): self{$this->nbrsessioninter = $nbrsessioninter;return $this;}public function getNbrsessionintra(): ?int{return $this->nbrsessionintra;}public function setNbrsessionintra(?int $nbrsessionintra): self{$this->nbrsessionintra = $nbrsessionintra;return $this;}public function getIsDefault(): ?bool{return $this->isDefault;}public function setIsDefault(?bool $isDefault): self{$this->isDefault = $isDefault;return $this;}public function isIsDefault(): ?bool{return $this->isDefault;}public function addModulemodaliteevaluationfinale(ModuleModaliteEvaluationFinale $modulemodaliteevaluationfinale): self{if (!$this->moduleModaliteEvaluationFinales->contains($modulemodaliteevaluationfinale)) {$this->moduleModaliteEvaluationFinales->add($modulemodaliteevaluationfinale);$modulemodaliteevaluationfinale->setModule($this);}return $this;}public function removeModulemodaliteevaluationfinale(ModuleModaliteEvaluationFinale $modulemodaliteevaluationfinale): self{// set the owning side to null (unless already changed)if ($this->moduleModaliteEvaluationFinales->removeElement($modulemodaliteevaluationfinale) && $modulemodaliteevaluationfinale->getModule() === $this) {$modulemodaliteevaluationfinale->setModule(null);}return $this;}/*** @return Collection<int, FormateurModule>*/public function getFormateurModules(): Collection{return $this->formateurModules;}public function addFormateurModule(FormateurModule $formateurModule): self{if (!$this->formateurModules->contains($formateurModule)) {$this->formateurModules->add($formateurModule);$formateurModule->setModule($this);}return $this;}public function removeFormateurModule(FormateurModule $formateurModule): self{// set the owning side to null (unless already changed)if ($this->formateurModules->removeElement($formateurModule) && $formateurModule->getModule() === $this) {$formateurModule->setModule(null);}return $this;}public function addTarifsVente(TarifVenteTheme $tarifsVente): self{if (!$this->tarifsVentes->contains($tarifsVente)) {$this->tarifsVentes->add($tarifsVente);$tarifsVente->setModule($this);}return $this;}public function removeTarifsVente(TarifVenteTheme $tarifsVente): self{// set the owning side to null (unless already changed)if ($this->tarifsVentes->removeElement($tarifsVente) && $tarifsVente->getModule() === $this) {$tarifsVente->setModule(null);}return $this;}public function addTarifsVenteIntra(TarifVenteThemeIntra $tarifsVenteIntra): self{if (!$this->tarifsVenteIntras->contains($tarifsVenteIntra)) {$this->tarifsVenteIntras->add($tarifsVenteIntra);$tarifsVenteIntra->setModule($this);}return $this;}public function removeTarifsVenteIntra(TarifVenteThemeIntra $tarifsVenteIntra): self{// set the owning side to null (unless already changed)if ($this->tarifsVenteIntras->removeElement($tarifsVenteIntra) && $tarifsVenteIntra->getModule() === $this) {$tarifsVenteIntra->setModule(null);}return $this;}public function getApiGestiform(): ?ApiGestiform{return $this->apiGestiform;}public function setApiGestiform(?ApiGestiform $apiGestiform): self{$this->apiGestiform = $apiGestiform;return $this;}public function getTarifVenteInterValeurActuel($valeur = null): float|int|null{$tarifActuel = $this->getTarifVenteActuel();if (!$tarifActuel) {return null;}$isJour = $tarifActuel->isTarifJour() ?? false;// Compute base hours/days from module duration when not provided$totalMinutes = (int) max(0, (int) ($this->duree ?? 0));$hours = $valeur === null ? ($totalMinutes / 60) : (float) $valeur;// Days rounded to nearest integer, half-up, as requested$daysRounded = (int) round(($totalMinutes / 60) / 7, 0, PHP_ROUND_HALF_UP);// Select the comparison value depending on tariff type$compareValue = $isJour ? $daysRounded : $hours;$matched = null;foreach ($tarifActuel->getLignes() as $ligne) {$min = $ligne->getValeurMin();$max = $ligne->getValeurMax();$inLower = ($min === null) || ($compareValue >= $min);$inUpper = ($max === null) || ($compareValue <= $max);if ($inLower && $inUpper) {$matched = $ligne;break;}}// Fallback: if none matched, choose the line with the smallest non-null min greater than compareValue,// otherwise the one with the smallest min overall.if ($matched === null) {$candidates = $tarifActuel->getLignes()->toArray();usort($candidates, function ($a, $b) {$amin = $a->getValeurMin(); $bmin = $b->getValeurMin();if ($amin === $bmin) { return 0; }if ($amin === null) { return -1; }if ($bmin === null) { return 1; }return $amin <=> $bmin;});foreach ($candidates as $cand) {if ($cand->getValeurMin() !== null && $compareValue <= $cand->getValeurMax() ?: PHP_INT_MAX) {$matched = $cand; break;}}if ($matched === null && count($candidates) > 0) {$matched = $candidates[0];}}if ($matched !== null && $matched->getTarif() !== null) {$qty = $isJour ? $daysRounded : $hours;return (float) $matched->getTarif() * $qty;}return null;}public function getTarifVenteActuel($datedujour = null): ?TarifVenteTheme{if (is_null($datedujour)) {$datedujour = new DateTime();}$datedujour->setTime(0, 0);if ($this->getTarifsVentes()) {foreach ($this->getTarifsVentes() as $tarif) {if ($tarif->getStart() <= $datedujour && ($tarif->getEnd() >= $datedujour || is_null($tarif->getEnd()))) {return $tarif;}}}return $this->getThemeTarif()?->getTarifVenteActuel()?? $this->getSousThemeTheme()?->getTheme()?->getTarifVenteActuel()?? null;}/*** @return Collection<int, TarifVenteTheme>*/public function getTarifsVentes(): Collection{return $this->tarifsVentes;}public function getThemeTarif(): ?Theme{return $this->themeTarif;}public function setThemeTarif(?Theme $themeTarif): self{$this->themeTarif = $themeTarif;return $this;}public function getSousThemeTheme(): ?SousThemeTheme{return $this->sousThemeTheme;}public function setSousThemeTheme(?SousThemeTheme $sousThemeTheme): self{$this->sousThemeTheme = $sousThemeTheme;return $this;}public function getOrigineTarifInter(): int{$tarifactuel = $this->getTarifVenteActuel();/*if(is_null($tarifactuel)){echo($this->getId());die(' fin ');}*/if (!is_null($tarifactuel)) {if (!is_null($tarifactuel->getModule())) {return 3;}if (!is_null($tarifactuel->getTheme())) {return 2;}if (is_null($tarifactuel->getTarifDefaut())) {return 1;}}return 0;}public function getOrigineTarifIntra(): int{$tarifactuel = $this->getTarifVenteIntraActuel();if (!is_null($tarifactuel->getModule())) {return 3;}if (!is_null($tarifactuel->getTheme())) {return 2;}if (is_null($tarifactuel->getTarifDefaut())) {return 1;}return 0;}// 0 -> ne sait pas// 1 -> tarif défaut// 2 -> thème// 3 -> modulepublic function getTarifVenteIntraActuel($datedujour = null){if (is_null($datedujour)) {$datedujour = new DateTime();$datedujour->setTime(0, 0);}$datedujour->setTime(0, 0);// retourne le tarif spécifique au moduleforeach ($this->getTarifsVenteIntras() as $tarif) {if ($tarif->getStart() <= $datedujour && ($tarif->getEnd() >= $datedujour || is_null($tarif->getEnd()))) {return $tarif;}}// retourne le tarif du thèmeif (!is_null($this->getThemeTarif())) {return $this->getThemeTarif()->getTarifVenteIntraActuel();}// n'a trouvé aucun tarifreturn null;}// 0 -> ne sait pas// 1 -> tarif défaut// 2 -> thème// 3 -> module/*** @return Collection<int, TarifVenteThemeIntra>*/public function getTarifsVenteIntras(): Collection{return $this->tarifsVenteIntras;}public function getTarifVenteIntraOfActuelJour($jour = null): float|int|null{if ($jour == null) {// duree is stored in minutes; convert to days (hours/7)$jour = (($this->duree ?? 0) / 60) / 7;}$tarifIntra = $this->getTarifVenteIntraActuel();if ($tarifIntra instanceof \App\Entity\Gestiform\Admin\Tarifs\TarifVenteThemeIntra) {foreach ($tarifIntra->getIntraJourOfs() as $ligne) {if ($ligne->getJour() == $jour) {return $ligne->getTarif() * $ligne->getJour();}}}return null;}public function getTarifVenteIntraClientActuelJour($jour = null){if ($jour == null) {// duree is stored in minutes; convert to days (hours/7)$jour = (($this->duree ?? 0) / 60) / 7;}$tarifIntra = $this->getTarifVenteIntraActuel();if ($tarifIntra instanceof \App\Entity\Gestiform\Admin\Tarifs\TarifVenteThemeIntra) {foreach ($tarifIntra->getIntraJourClients() as $ligne) {if ($ligne->getJour() == $jour) {return $ligne->getTarif() * $ligne->getJour();}}}return null;}public function getEvents(): Collection{return $this->events;}public function addEvent(Event $event): self{if (!$this->events->contains($event)) {$this->events->add($event);$event->setModule($this);}return $this;}public function removeEvent(Event $event): self{// set the owning side to null (unless already changed)if ($this->events->removeElement($event) && $event->getModule() === $this) {$event->setModule(null);}return $this;}/*** @return Collection<int, Certification>*/public function getCertifications(): Collection{return $this->certifications;}public function setCertifications(Collection $certifications): self{$this->certifications = $certifications;return $this;}public function addCertification(Certification $certification): self{if (!$this->certifications->contains($certification)) {$this->certifications->add($certification);}return $this;}public function removeCertification(Certification $certification): self{$this->certifications->removeElement($certification);return $this;}public function getFullIntituleType(): string{$type = $this instanceof Certification ? 'certification' : 'module';return $this->intitule . ' (' . $type . ')';}public function getType(): string{return $this instanceof Certification ? 'certification' : 'module';}/*** @return Collection<int, Document>*/public function getDocuments(): Collection{return $this->documents;}public function addDocument(Document $document): self{if (!$this->documents->contains($document)) {$this->documents->add($document);$document->setModule($this);}return $this;}public function removeDocument(Document $document): self{// set the owning side to null (unless already changed)if ($this->documents->removeElement($document) && $document->getModule() === $this) {$document->setModule(null);}return $this;}}