<?php
namespace App\Entity;
use App\Repository\FormationRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass=FormationRepository::class)
* @UniqueEntity(fields={"wording"},message="Ce nom est déjà utilisé." )
* @Vich\Uploadable
*/
class Formation
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $wording;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $long_wording;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $duration;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private $color;
/**
* @ORM\Column(type="integer")
*/
private $max_student;
/**
* @ORM\Column(type="float")
*/
private $price;
/**
* @ORM\OneToMany(targetEntity=Session::class, mappedBy="formation")
*/
private $sessions;
/**
* @ORM\OneToMany(targetEntity=JustifForm::class, mappedBy="formation",cascade={"persist","remove"})
*/
private $justifForms;
/**
* @ORM\ManyToOne(targetEntity=Demande::class, inversedBy="formation",cascade={"persist"})
*/
private $demande;
/**
* @ORM\OneToMany(targetEntity=Demande::class, mappedBy="positionnement")
*/
private $positionnement;
/**
* @Doctrine\ORM\Mapping\Column(type="string", length=255, nullable=true)
*/
private $image;
/**
* @Vich\UploadableField(mapping="logo_formation", fileNameProperty="image")
*/
private $fichier;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $updateAt;
/**
* @ORM\ManyToOne(targetEntity=CategorieFormation::class, inversedBy="formations")
*/
private $categorieformation;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $certificat;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $attestation;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $diplome;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $carte;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $objectif;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $wordingdiplome;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $formateur;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $longformation;
/**
* @ORM\OneToMany(targetEntity=OptionCategorieInscrit::class, mappedBy="formation", cascade={"persist", "remove"})
*/
private $optionCategorieInscrits;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $online;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $publicVise;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $competenceVise;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $modaliteEvaluation;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lieu;
/**
* @ORM\Column(type="text", length=255, nullable=true)
*/
private $DelaiAcces;
/**
* @ORM\Column(type="text", length=255, nullable=true)
*/
private $TauxReussite;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $Prerequis;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $NiveauSortie;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $contenu;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $Debouche;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $methodeApprentissage;
/**
* @ORM\ManyToMany(targetEntity=DemandeDevisSite::class, mappedBy="formation")
*/
private $demandeDevisSites;
/**
* @ORM\OneToMany(targetEntity=StagaireDemandeDevis::class, mappedBy="Formation")
*/
private $stagaireDemandeDevis;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $evaluation;
/**
* @ORM\ManyToMany(targetEntity=ModuleSession::class, cascade={"persist"})
*/
private $modules;
/**
* @ORM\OneToMany(targetEntity=DemandeDevisLigne::class, mappedBy="formation")
*/
private $demandeDevisLignes;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $elearning;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $thinkificId;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $thinkificQcmId;
/**
* @ORM\ManyToMany(targetEntity=ChecklistClotureSession::class, inversedBy="formations")
*/
private $requis;
/**
* @ORM\OneToMany(targetEntity=FormationDocument::class, mappedBy="formation")
*/
private $document;
/**
* @ORM\Column(type="string", length=255)
*/
private $imageimage;
/**
* @Vich\UploadableField(mapping="image_formation", fileNameProperty="imageimage")
*/
private $picture;
/**
* @ORM\ManyToMany(targetEntity=FormationMenu::class, inversedBy="formations")
*/
private $menu;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $initiale;
/**
* @ORM\OneToMany(targetEntity=LigneConvention::class, mappedBy="Formation")
*/
private $ligneConventions;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $livretStagiaire;
/**
* @Vich\UploadableField(mapping="livret_stagiaire", fileNameProperty="livretStagiaire")
*/
private $fichierLivret;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $ispublish;
/**
* @ORM\OneToMany(targetEntity="App\Entity\PlanDeFormation", mappedBy="formation", cascade={"persist", "remove"})
*/
private $planDeFormations;
///**
// * @ORM\Column(type="boolean", nullable=true)
// */
//private $certificatMedical;
/**
* @ORM\OneToMany(targetEntity=DemandePro::class, mappedBy="formation")
*/
private $demandePros;
public function __construct()
{
$this->sessions = new ArrayCollection();
$this->justifForms = new ArrayCollection();
$this->positionnement = new ArrayCollection();
$this->optionCategorieInscrits = new ArrayCollection();
$this->demandeDevisSites = new ArrayCollection();
$this->stagaireDemandeDevis = new ArrayCollection();
$this->modules = new ArrayCollection();
$this->demandeDevisLignes = new ArrayCollection();
$this->requis = new ArrayCollection();
$this->document = new ArrayCollection();
$this->menu = new ArrayCollection();
$this->ligneConventions = new ArrayCollection();
$this->planDeFormations = new ArrayCollection();
$this->demandePros = new ArrayCollection();
}
public function __toString()
{
return $this->getWording();
}
public function getId(): ?int
{
return $this->id;
}
public function getWording(): ?string
{
return $this->wording;
}
public function setWording(string $wording): self
{
$this->wording = $wording;
return $this;
}
public function isOnline(): ?bool
{
return $this->online;
}
public function setOnline(?bool $online): self
{
$this->online = $online;
return $this;
}
public function getPublicVise(): ?string
{
return $this->publicVise;
}
public function setPublicVise(?string $publicVise): self
{
$this->publicVise = $publicVise;
return $this;
}
public function getCompetenceVise(): ?string
{
return $this->competenceVise;
}
public function setCompetenceVise(?string $competenceVise): self
{
$this->competenceVise = $competenceVise;
return $this;
}
public function getModaliteEvaluation(): ?string
{
return $this->modaliteEvaluation;
}
public function setModaliteEvaluation(?string $modaliteEvaluation): self
{
$this->modaliteEvaluation = $modaliteEvaluation;
return $this;
}
public function getLieu(): ?string
{
return $this->lieu;
}
public function setLieu(?string $lieu): self
{
$this->lieu = $lieu;
return $this;
}
public function getDelaiAcces(): ?string
{
return $this->DelaiAcces;
}
public function setDelaiAcces(?string $DelaiAcces): self
{
$this->DelaiAcces = $DelaiAcces;
return $this;
}
public function getTauxReussite(): ?string
{
return $this->TauxReussite;
}
public function setTauxReussite(?string $TauxReussite): self
{
$this->TauxReussite = $TauxReussite;
return $this;
}
public function getPrerequis(): ?string
{
return $this->Prerequis;
}
public function setPrerequis(?string $Prerequis): self
{
$this->Prerequis = $Prerequis;
return $this;
}
public function getNiveauSortie(): ?string
{
return $this->NiveauSortie;
}
public function setNiveauSortie(?string $NiveauSortie): self
{
$this->NiveauSortie = $NiveauSortie;
return $this;
}
public function getContenu(): ?string
{
return $this->contenu;
}
public function setContenu(?string $contenu): self
{
$this->contenu = $contenu;
return $this;
}
public function getDebouche(): ?string
{
return $this->Debouche;
}
public function setDebouche(?string $Debouche): self
{
$this->Debouche = $Debouche;
return $this;
}
public function getMethodeApprentissage(): ?string
{
return $this->methodeApprentissage;
}
public function setMethodeApprentissage(?string $methodeApprentissage): self
{
$this->methodeApprentissage = $methodeApprentissage;
return $this;
}
/**
* @return Collection<int, DemandeDevisSite>
*/
public function getDemandeDevisSites(): Collection
{
return $this->demandeDevisSites;
}
public function addDemandeDevisSite(DemandeDevisSite $demandeDevisSite): self
{
if (!$this->demandeDevisSites->contains($demandeDevisSite)) {
$this->demandeDevisSites[] = $demandeDevisSite;
$demandeDevisSite->addFormation($this);
}
return $this;
}
public function removeDemandeDevisSite(DemandeDevisSite $demandeDevisSite): self
{
if ($this->demandeDevisSites->removeElement($demandeDevisSite)) {
$demandeDevisSite->removeFormation($this);
}
return $this;
}
/**
* @return Collection<int, StagaireDemandeDevis>
*/
public function getStagaireDemandeDevis(): Collection
{
return $this->stagaireDemandeDevis;
}
public function addStagaireDemandeDevi(StagaireDemandeDevis $stagaireDemandeDevi): self
{
if (!$this->stagaireDemandeDevis->contains($stagaireDemandeDevi)) {
$this->stagaireDemandeDevis[] = $stagaireDemandeDevi;
$stagaireDemandeDevi->setFormation($this);
}
return $this;
}
public function removeStagaireDemandeDevi(StagaireDemandeDevis $stagaireDemandeDevi): self
{
if ($this->stagaireDemandeDevis->removeElement($stagaireDemandeDevi)) {
// set the owning side to null (unless already changed)
if ($stagaireDemandeDevi->getFormation() === $this) {
$stagaireDemandeDevi->setFormation(null);
}
}
return $this;
}
public function getLongWording(): ?string
{
return $this->long_wording;
}
public function setLongWording(?string $long_wording): self
{
$this->long_wording = $long_wording;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getDuration(): ?float
{
return $this->duration;
}
public function setDuration(?float $duration): self
{
$this->duration = $duration;
return $this;
}
public function getColor(): ?string
{
return $this->color;
}
public function setColor(?string $color): self
{
$this->color = $color;
return $this;
}
public function getMaxStudent(): ?int
{
return $this->max_student;
}
public function setMaxStudent(int $max_student): self
{
$this->max_student = $max_student;
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(float $price): self
{
$this->price = $price;
return $this;
}
/**
* @return Collection<int, Session>
*/
public function getSessions(): Collection
{
return $this->sessions;
}
public function addSession(Session $session): self
{
if (!$this->sessions->contains($session)) {
$this->sessions[] = $session;
$session->setFormation($this);
}
return $this;
}
public function removeSession(Session $session): self
{
if ($this->sessions->removeElement($session)) {
// set the owning side to null (unless already changed)
if ($session->getFormation() === $this) {
$session->setFormation(null);
}
}
return $this;
}
/**
* @return Collection<int, JustifForm>
*/
public function getJustifForms(): Collection
{
return $this->justifForms;
}
public function addJustifForm(JustifForm $justifForm): self
{
if (!$this->justifForms->contains($justifForm)) {
$this->justifForms[] = $justifForm;
$justifForm->setFormation($this);
}
return $this;
}
public function removeJustifForm(JustifForm $justifForm): self
{
if ($this->justifForms->removeElement($justifForm)) {
// set the owning side to null (unless already changed)
if ($justifForm->getFormation() === $this) {
$justifForm->setFormation(null);
}
}
return $this;
}
public function getDemande(): ?Demande
{
return $this->demande;
}
public function setDemande(?Demande $demande): self
{
$this->demande = $demande;
return $this;
}
/**
* @return Collection<int, Demande>
*/
public function getPositionnement(): Collection
{
return $this->positionnement;
}
public function addPositionnement(Demande $positionnement): self
{
if (!$this->positionnement->contains($positionnement)) {
$this->positionnement[] = $positionnement;
$positionnement->setPositionnement($this);
}
return $this;
}
public function removePositionnement(Demande $positionnement): self
{
if ($this->positionnement->removeElement($positionnement)) {
// set the owning side to null (unless already changed)
if ($positionnement->getPositionnement() === $this) {
$positionnement->setPositionnement(null);
}
}
return $this;
}
public function setFichier(?File $image = null)
{
$this->fichier = $image;
if ($image) {
$this->updateAt = new \DateTimeImmutable();
}
}
public function getFichier()
{
return $this->fichier;
}
public function setImage($image)
{
$this->image = $image;
}
public function getImage()
{
return $this->image;
}
public function getUpdateAt(): ?\DateTimeImmutable
{
return $this->updateAt;
}
public function setUpdateAt(?\DateTimeImmutable $updateAt): self
{
$this->updateAt = $updateAt;
return $this;
}
public function getCategorieformation(): ?CategorieFormation
{
return $this->categorieformation;
}
public function setCategorieformation(?CategorieFormation $categorieformation): self
{
$this->categorieformation = $categorieformation;
return $this;
}
public function isCertificat(): ?bool
{
return $this->certificat;
}
public function setCertificat(?bool $certificat): self
{
$this->certificat = $certificat;
return $this;
}
public function isAttestation(): ?bool
{
return $this->attestation;
}
public function setAttestation(?bool $attestation): self
{
$this->attestation = $attestation;
return $this;
}
public function isDiplome(): ?bool
{
return $this->diplome;
}
public function setDiplome(?bool $diplome): self
{
$this->diplome = $diplome;
return $this;
}
public function isCarte(): ?bool
{
return $this->carte;
}
public function setCarte(?bool $carte): self
{
$this->carte = $carte;
return $this;
}
public function getObjectif(): ?string
{
return $this->objectif;
}
public function setObjectif(?string $objectif): self
{
$this->objectif = $objectif;
return $this;
}
public function getWordingdiplome(): ?string
{
return $this->wordingdiplome;
}
public function setWordingdiplome(?string $wordingdiplome): self
{
$this->wordingdiplome = $wordingdiplome;
return $this;
}
public function isFormateur(): ?bool
{
return $this->formateur;
}
public function setFormateur(?bool $formateur): self
{
$this->formateur = $formateur;
return $this;
}
public function isLongformation(): ?bool
{
return $this->longformation;
}
public function setLongformation(?bool $longformation): self
{
$this->longformation = $longformation;
return $this;
}
/**
* @return Collection<int, OptionCategorieInscrit>
*/
public function getOptionCategorieInscrits(): Collection
{
return $this->optionCategorieInscrits;
}
public function addOptionCategorieInscrit(OptionCategorieInscrit $optionCategorieInscrit): self
{
if (!$this->optionCategorieInscrits->contains($optionCategorieInscrit)) {
$this->optionCategorieInscrits[] = $optionCategorieInscrit;
$optionCategorieInscrit->setFormation($this);
}
return $this;
}
public function removeOptionCategorieInscrit(OptionCategorieInscrit $optionCategorieInscrit): self
{
if ($this->optionCategorieInscrits->removeElement($optionCategorieInscrit)) {
// set the owning side to null (unless already changed)
if ($optionCategorieInscrit->getFormation() === $this) {
$optionCategorieInscrit->setFormation(null);
}
}
return $this;
}
public function isEvaluation(): ?bool
{
return $this->evaluation;
}
public function setEvaluation(?bool $online): self
{
$this->evaluation = $online;
return $this;
}
/**
* @return Collection<int, ModuleSession>
*/
public function getModules(): Collection
{
return $this->modules;
}
public function addModule(ModuleSession $module): self
{
if (!$this->modules->contains($module)) {
$this->modules[] = $module;
}
return $this;
}
public function removeModule(ModuleSession $module): self
{
$this->modules->removeElement($module);
return $this;
}
/**
* @return Collection<int, DemandeDevisLigne>
*/
public function getDemandeDevisLignes(): Collection
{
return $this->demandeDevisLignes;
}
public function addDemandeDevisLigne(DemandeDevisLigne $demandeDevisLigne): self
{
if (!$this->demandeDevisLignes->contains($demandeDevisLigne)) {
$this->demandeDevisLignes[] = $demandeDevisLigne;
$demandeDevisLigne->setFormation($this);
}
return $this;
}
public function removeDemandeDevisLigne(DemandeDevisLigne $demandeDevisLigne): self
{
if ($this->demandeDevisLignes->removeElement($demandeDevisLigne)) {
// set the owning side to null (unless already changed)
if ($demandeDevisLigne->getFormation() === $this) {
$demandeDevisLigne->setFormation(null);
}
}
return $this;
}
public function getElearning(): ?int
{
return $this->elearning;
}
public function setElearning(?int $elearning): self
{
$this->elearning = $elearning;
return $this;
}
public function getThinkificId(): ?int
{
return $this->thinkificId;
}
public function setThinkificId(?int $thinkificId): self
{
$this->thinkificId = $thinkificId;
return $this;
}
public function getThinkificQcmId(): ?int
{
return $this->thinkificQcmId;
}
public function setThinkificQcmId(?int $thinkificQcmId): self
{
$this->thinkificQcmId = $thinkificQcmId;
return $this;
}
/**
* @return Collection<int, ChecklistClotureSession>
*/
public function getRequis(): Collection
{
return $this->requis;
}
public function addRequi(ChecklistClotureSession $requi): self
{
if (!$this->requis->contains($requi)) {
$this->requis[] = $requi;
}
return $this;
}
public function removeRequi(ChecklistClotureSession $requi): self
{
$this->requis->removeElement($requi);
return $this;
}
/**
* @return Collection<int, FormationDocument>
*/
public function getDocument(): Collection
{
return $this->document;
}
public function addDocument(FormationDocument $document): self
{
if (!$this->document->contains($document)) {
$this->document[] = $document;
$document->setFormation($this);
}
return $this;
}
public function removeDocument(FormationDocument $document): self
{
if ($this->document->removeElement($document)) {
// set the owning side to null (unless already changed)
if ($document->getFormation() === $this) {
$document->setFormation(null);
}
}
return $this;
}
public function getImageimage(): ?string
{
return $this->imageimage;
}
public function setImageimage(?string $imageimage): self
{
$this->imageimage = $imageimage;
return $this;
}
public function setPicture(?File $imageimage = null): self
{
$this->picture = $imageimage;
if ($imageimage) {
$this->updateAt = new \DateTimeImmutable();
}
return $this;
}
public function getPicture()
{
return $this->picture;
}
/**
* @return Collection<int, FormationMenu>
*/
public function getMenu(): Collection
{
return $this->menu;
}
public function addMenu(FormationMenu $menu): self
{
if (!$this->menu->contains($menu)) {
$this->menu[] = $menu;
}
return $this;
}
public function removeMenu(FormationMenu $menu): self
{
$this->menu->removeElement($menu);
return $this;
}
public function isInitiale(): ?bool
{
return $this->initiale;
}
public function setInitiale(?bool $initiale): self
{
$this->initiale = $initiale;
return $this;
}
/**
* @return Collection<int, LigneConvention>
*/
public function getLigneConventions(): Collection
{
return $this->ligneConventions;
}
public function addLigneConvention(LigneConvention $ligneConvention): self
{
if (!$this->ligneConventions->contains($ligneConvention)) {
$this->ligneConventions[] = $ligneConvention;
$ligneConvention->setFormation($this);
}
return $this;
}
public function removeLigneConvention(LigneConvention $ligneConvention): self
{
if ($this->ligneConventions->removeElement($ligneConvention)) {
// set the owning side to null (unless already changed)
if ($ligneConvention->getFormation() === $this) {
$ligneConvention->setFormation(null);
}
}
return $this;
}
public function getLivretStagiaire(): ?string
{
return $this->livretStagiaire;
}
public function setLivretStagiaire(?string $livretStagiaire): self
{
$this->livretStagiaire = $livretStagiaire;
return $this;
}
public function getFichierLivret()
{
return $this->fichierLivret;
}
public function setFichierLivret(?File $livretStagiaire = null)
{
$this->fichierLivret = $livretStagiaire;
if ($livretStagiaire) {
$this->updateAt = new \DateTimeImmutable();
}
}
public function isPublish(): ?bool
{
return $this->ispublish;
}
public function setIsPublish(?bool $ispublish): self
{
$this->ispublish = $ispublish;
return $this;
}
/**
* @return Collection|PlanDeFormation[]
*/
public function getPlanDeFormations(): Collection
{
return $this->planDeFormations;
}
public function addPlanDeFormation(PlanDeFormation $planDeFormation): self
{
// if (!$this->planDeFormations->contains($planDeFormation)) {
// $this->planDeFormations[] = $planDeFormation;
// }
if (!$this->planDeFormations->contains($planDeFormation)) {
$this->planDeFormations[] = $planDeFormation;
$planDeFormation->setFormation($this);
}
return $this;
}
public function removePlanDeFormation(PlanDeFormation $planDeFormation): self
{
if ($this->planDeFormations->removeElement($planDeFormation)) {
if ($planDeFormation->getFormation() === $this) {
$planDeFormation->setFormation(null);
}
}
return $this;
}
// public function isCertificatMedical(): ?bool
// {
// return $this->certificatMedical;
// }
// public function setCertificatMedical(?bool $certificatMedical): self
// {
// $this->certificatMedical = $certificatMedical;
// return $this;
// }
/**
* @return Collection<int, DemandePro>
*/
public function getDemandePros(): Collection
{
return $this->demandePros;
}
public function addDemandePro(DemandePro $demandePro): self
{
if (!$this->demandePros->contains($demandePro)) {
$this->demandePros[] = $demandePro;
$demandePro->setFormation($this);
}
return $this;
}
public function removeDemandePro(DemandePro $demandePro): self
{
if ($this->demandePros->removeElement($demandePro)) {
// set the owning side to null (unless already changed)
if ($demandePro->getFormation() === $this) {
$demandePro->setFormation(null);
}
}
return $this;
}
}