<?php
namespace 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\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\Repository\Gestiform\Formations\Catalogue\Module\ModuleRepository;
use App\Trait\ApiGestiformEntity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Entity(repositoryClass=ModuleRepository::class)
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="type", type="string")
* @ORM\DiscriminatorMap({
* "module" = "Module",
* "certification" = "App\Entity\Gestiform\Formations\Catalogue\Certification",
* })
*/
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="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="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="string", length=255, nullable=true)
*/
private ?string $altVignette = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $description = 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(type="integer", nullable=true)
*/
private ?int $nbrsessioninter = null;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $nbrsessionintra = null;
/**
* @ORM\OneToMany(targetEntity=Event::class, mappedBy="module")
*/
private Collection $events;
/**
* @ORM\OneToMany(targetEntity=BlocModule::class, mappedBy="module",cascade={"persist"})
*/
private Collection $blocModules;
/**
* @ORM\OneToMany(targetEntity=Chapitre::class, mappedBy="module",cascade={"persist"})
*/
private Collection $chapitres;
/**
* @ORM\ManyToOne(targetEntity=Masterlistelg::class)
* @ORM\JoinColumn(nullable=true)
*/
private ?Masterlistelg $modeFormation = null;
/**
* @ORM\ManyToOne(targetEntity=SousThemeTheme::class, inversedBy="modules")
* @ORM\JoinColumn(nullable=true)
*/
private ?SousThemeTheme $sousThemeTheme = null;
/**
* @ORM\ManyToOne(targetEntity=Theme::class)
*/
private ?Theme $themeTarif = null;
/**
* @ORM\ManyToMany(targetEntity=Module::class)
* @ORM\JoinTable(name="module_exige_avant")
*/
private Collection $modulesExigeAvant;
/**
* @ORM\ManyToMany(targetEntity=Module::class)
* @ORM\JoinTable(name="module_souhaitable_avant")
*/
private Collection $modulesSouhaitableAvant;
/**
* @ORM\ManyToMany(targetEntity=Module::class)
* @ORM\JoinTable(name="module_conseille_apres")
*/
private Collection $modulesConseilleApres;
/**
* @ORM\OneToMany(targetEntity=ModuleCompetence::class, mappedBy="module",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\OneToMany(targetEntity=ModuleModaliteEvaluationFinale::class, mappedBy="module",cascade={"persist"})
* @ORM\JoinColumn(nullable=true)
*/
private Collection $moduleModaliteEvaluationFinales;
/**
* @ORM\ManyToOne(targetEntity=Upload::class, cascade={"persist", "remove"})
* @ORM\JoinColumn(nullable=true)
*/
private ?Upload $banniere = null;
/**
* @ORM\ManyToOne(targetEntity=Upload::class, cascade={"persist", "remove"})
* @ORM\JoinColumn(nullable=true)
*/
private ?Upload $vignette = null;
/**
* @ORM\OneToMany(targetEntity=FormateurModule::class, mappedBy="module")
*/
private Collection $formateurModules;
/**
* @ORM\OneToMany(targetEntity=TarifVenteTheme::class, mappedBy="module", cascade={"persist", "remove"})
*/
private Collection $tarifsVentes;
/**
* @ORM\OneToMany(targetEntity=TarifVenteThemeIntra::class, mappedBy="module", cascade={"persist", "remove"})
*/
private Collection $tarifsVenteIntras;
/**
* @ORM\ManyToMany(targetEntity=Certification::class, inversedBy="modules", cascade={"persist"})
*/
private Collection $certifications;
/**
* @ORM\OneToMany(targetEntity=Document::class, mappedBy="module",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 getDuree(): ?int
{
return $this->duree;
}
public function setDuree(int $duree): self
{
$this->duree = $duree;
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 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 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 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
{
if ($this->blocModules->removeElement($blocModule)) {
// set the owning side to null (unless already changed)
if ($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
{
if ($this->chapitres->removeElement($chapitre)) {
// set the owning side to null (unless already changed)
if ($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
{
if ($this->moduleCompetences->removeElement($moduleCompetence)) {
// set the owning side to null (unless already changed)
if ($moduleCompetence->getModule() === $this) {
$moduleCompetence->setModule(null);
}
}
return $this;
}
/**
* @return Collection<int, \App\Entity\Gestiform\Formations\Financeur\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 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
{
if ($this->moduleModaliteEvaluationFinales->removeElement($moduleModaliteEvaluationFinale)) {
// set the owning side to null (unless already changed)
if ($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
{
if ($this->moduleModaliteEvaluationFinales->removeElement($modulemodaliteevaluationfinale)) {
// set the owning side to null (unless already changed)
if ($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
{
if ($this->formateurModules->removeElement($formateurModule)) {
// set the owning side to null (unless already changed)
if ($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
{
if ($this->tarifsVentes->removeElement($tarifsVente)) {
// set the owning side to null (unless already changed)
if ($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
{
if ($this->tarifsVenteIntras->removeElement($tarifsVenteIntra)) {
// set the owning side to null (unless already changed)
if ($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
{
if ($valeur == null) {
if ($this->getTarifVenteActuel()->isTarifJour()) {
$valeur = $this->duree / 7;
} else {
$valeur = $this->duree;
}
}
foreach ($this->getTarifVenteActuel()->getLignes() as $ligne) {
if ($this->getTarifVenteActuel()->isTarifJour()) {
if ($ligne->getValeurmin() == $valeur) {
return $ligne->getTarif() * $valeur;
}
} else {
if ($valeur >= $ligne->getValeurMin() && $valeur <= $ligne->getValeurMax()) {
return $ligne->getTarif() * $valeur;
}
}
}
return null;
}
public function getTarifVenteActuel($datedujour = null)
{
if (is_null($datedujour)) {
$datedujour = new \DateTime();
}
$datedujour->setTime(0, 0);
// retourne le tarif spécifique au module
foreach ($this->getTarifsVentes() as $tarif) {
if ($tarif->getStart() <= $datedujour && ($tarif->getEnd() >= $datedujour || is_null($tarif->getEnd()))) {
return $tarif;
}
}
// retourne le tarif du thème
if (!is_null($this->getThemeTarif())) {
return $this->getThemeTarif()->getTarifVenteActuel();
}
// retourne le tarif du thème
if (!is_null($this->getSousThemeTheme())) {
return $this->getSousThemeTheme()->getTheme()->getTarifVenteActuel();
}
// retourne le tarif du thème
if (!is_null($this->getThemeTarif())) {
return $this->getThemeTarif();
}
// n'a trouvé aucun tarif
return 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 -> module
public 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 module
foreach ($this->getTarifsVenteIntras() as $tarif) {
if ($tarif->getStart() <= $datedujour && ($tarif->getEnd() >= $datedujour || is_null($tarif->getEnd()))) {
return $tarif;
}
}
// retourne le tarif du thème
if (!is_null($this->getThemeTarif())) {
return $this->getThemeTarif()->getTarifVenteIntraActuel();
}
// n'a trouvé aucun tarif
return 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) {
$jour = $this->duree / 7;
}
if (!is_null($this->getTarifVenteIntraActuel())) {
foreach ($this->getTarifVenteIntraActuel()->getIntraJourOfs() as $ligne) {
if ($ligne->getJour() == $jour) {
return $ligne->getTarif() * $ligne->getJour();
}
}
}
return null;
}
public function getTarifVenteIntraClientActuelJour($jour = null)
{
if ($jour == null) {
$jour = $this->duree / 7;
}
if (!is_null($this->getTarifVenteIntraActuel())) {
foreach ($this->getTarifVenteIntraActuel()->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
{
if ($this->events->removeElement($event)) {
// set the owning side to null (unless already changed)
if ($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
{
if ($this->documents->removeElement($document)) {
// set the owning side to null (unless already changed)
if ($document->getModule() === $this) {
$document->setModule(null);
}
}
return $this;
}
}