src/Entity/Formateur.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FormateurRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * @ORM\Entity(repositoryClass=FormateurRepository::class)
  11.  * @UniqueEntity(
  12.  *      fields={"email"},
  13.  *      message="Ce mail est déjà utilisé."
  14.  * )
  15.  * @UniqueEntity(fields={"telephone"},message="Ce téléphone est déjà utilisé." )
  16.  */
  17. class Formateur
  18. {
  19.     /**
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue
  22.      * @ORM\Column(type="integer")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @ORM\Column(type="string", length=40)
  27.      */
  28.     private $firstname;
  29.     /**
  30.      * @ORM\Column(type="string", length=40)
  31.      */
  32.     private $lastname;
  33.     /**
  34.      * @ORM\Column(type="string", length=255,nullable=true)
  35.      * @Assert\Email(message = "L'email '{{ value }}' n'est pas valide.")
  36.      */
  37.     private $email;
  38.     /**
  39.      * @ORM\Column(type="text", nullable=true)
  40.      */
  41.     private $address;
  42.      /**
  43.      * @ORM\Column(type="string", length=40, nullable=true)
  44.      * @Assert\Length(min=8,minMessage = "La taille minimum doit être de {{ limit }} caractères")
  45.      */
  46.     private $telephone;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity=PieceFormateurFourni::class, mappedBy="formateur", cascade={"persist"})
  49.      */
  50.     private $pieceFormateurFournis;
  51.     /**
  52.      * @ORM\OneToMany(targetEntity=DiplomeFormateur::class, mappedBy="formateur", orphanRemoval=true, cascade={"persist"})
  53.      */
  54.     private $diplomeFormateurs;
  55.     /**
  56.      * @ORM\Column(type="date", nullable=true)
  57.      */
  58.     private $datenaissance;
  59.     /**
  60.      * @ORM\Column(type="string", length=255)
  61.      */
  62.     private $lieunaissance;
  63.     /**
  64.      * @ORM\Column(type="string", length=255,nullable=true)
  65.      */
  66.     private $numerosecuritesociale;
  67.     /**
  68.      * @ORM\Column(type="string", length=255, nullable=true)
  69.      */
  70.     private $specialisation;
  71.     /**
  72.      * @ORM\Column(type="string", length=255, nullable=true)
  73.      */
  74.     private $titre;
  75.     /**
  76.      * @ORM\Column(type="string", length=255, nullable=true)
  77.      */
  78.     private $qualite;
  79.     /**
  80.      * @ORM\Column(type="text", nullable=true)
  81.      */
  82.     private $experience;
  83.     /**
  84.      * @ORM\OneToMany(targetEntity=FactureFormateur::class, mappedBy="formateur")
  85.      */
  86.     private $factureFormateurs;
  87.     /**
  88.      * @ORM\OneToMany(targetEntity=Emargement::class, mappedBy="formateur")
  89.      */
  90.     private $emargements;
  91.     /**
  92.      * @ORM\OneToMany(targetEntity=FicheSuivieStagiaireTfpaps::class, mappedBy="formateur")
  93.      */
  94.     private $ficheSuivieStagiaireTfpaps;
  95.     /**
  96.      * @ORM\OneToMany(targetEntity=FicheSuivieStagiaireCqpDssp::class, mappedBy="formateur")
  97.      */
  98.     private $ficheSuivieStagiaireCqpDssps;
  99.     public function __construct()
  100.     {
  101.         $this->pieceFormateurFournis = new ArrayCollection();
  102.         $this->diplomeFormateurs = new ArrayCollection();
  103.         $this->sessions = new ArrayCollection();
  104.         $this->factureFormateurs = new ArrayCollection();
  105.         $this->emargements = new ArrayCollection();
  106.         $this->ficheSuivieStagiaireTfpaps = new ArrayCollection();
  107.         $this->ficheSuivieStagiaireCqpDssps = new ArrayCollection();
  108.     }
  109.     public function getId(): ?int
  110.     {
  111.         return $this->id;
  112.     }
  113.     public function getFirstname(): ?string
  114.     {
  115.         return $this->firstname;
  116.     }
  117.     public function setFirstname(string $firstname): self
  118.     {
  119.         $this->firstname $firstname;
  120.         return $this;
  121.     }
  122.     public function getLastname(): ?string
  123.     {
  124.         return $this->lastname;
  125.     }
  126.     public function setLastname(string $lastname): self
  127.     {
  128.         $this->lastname $lastname;
  129.         return $this;
  130.     }
  131.     public function getEmail(): ?string
  132.     {
  133.         return $this->email;
  134.     }
  135.     public function setEmail(string $email): self
  136.     {
  137.         $this->email $email;
  138.         return $this;
  139.     }
  140.     public function getAddress(): ?string
  141.     {
  142.         return $this->address;
  143.     }
  144.     public function setAddress(?string $address): self
  145.     {
  146.         $this->address $address;
  147.         return $this;
  148.     }
  149.     public function getTelephone(): ?string
  150.     {
  151.         return $this->telephone;
  152.     }
  153.     public function setTelephone(?string $telephone): self
  154.     {
  155.         $this->telephone $telephone;
  156.         return $this;
  157.     }
  158.     /**
  159.      * @return Collection<int, PieceFormateurFourni>
  160.      */
  161.     public function getPieceFormateurFournis(): Collection
  162.     {
  163.         return $this->pieceFormateurFournis;
  164.     }
  165.     public function addPieceFormateurFourni(PieceFormateurFourni $pieceFormateurFourni): self
  166.     {
  167.         if (!$this->pieceFormateurFournis->contains($pieceFormateurFourni)) {
  168.             $this->pieceFormateurFournis[] = $pieceFormateurFourni;
  169.             $pieceFormateurFourni->setFormateur($this);
  170.         }
  171.         return $this;
  172.     }
  173.     public function removePieceFormateurFourni(PieceFormateurFourni $pieceFormateurFourni): self
  174.     {
  175.         if ($this->pieceFormateurFournis->removeElement($pieceFormateurFourni)) {
  176.             // set the owning side to null (unless already changed)
  177.             if ($pieceFormateurFourni->getFormateur() === $this) {
  178.                 $pieceFormateurFourni->setFormateur(null);
  179.             }
  180.         }
  181.         return $this;
  182.     }
  183.     /**
  184.      * @return Collection<int, DiplomeFormateur>
  185.      */
  186.     public function getDiplomeFormateurs(): Collection
  187.     {
  188.         return $this->diplomeFormateurs;
  189.     }
  190.     public function addDiplomeFormateur(DiplomeFormateur $diplomeFormateur): self
  191.     {
  192.         if (!$this->diplomeFormateurs->contains($diplomeFormateur)) {
  193.             $this->diplomeFormateurs[] = $diplomeFormateur;
  194.             $diplomeFormateur->setFormateur($this);
  195.         }
  196.         return $this;
  197.     }
  198.     public function removeDiplomeFormateur(DiplomeFormateur $diplomeFormateur): self
  199.     {
  200.         if ($this->diplomeFormateurs->removeElement($diplomeFormateur)) {
  201.             // set the owning side to null (unless already changed)
  202.             if ($diplomeFormateur->getFormateur() === $this) {
  203.                 $diplomeFormateur->setFormateur(null);
  204.             }
  205.         }
  206.         return $this;
  207.     }
  208.     public function getDatenaissance(): ?\DateTimeInterface
  209.     {
  210.         return $this->datenaissance;
  211.     }
  212.     public function setDatenaissance(?\DateTimeInterface $datenaissance): self
  213.     {
  214.         $this->datenaissance $datenaissance;
  215.         return $this;
  216.     }
  217.     public function getLieunaissance(): ?string
  218.     {
  219.         return $this->lieunaissance;
  220.     }
  221.     public function setLieunaissance(string $lieunaissance): self
  222.     {
  223.         $this->lieunaissance $lieunaissance;
  224.         return $this;
  225.     }
  226.     public function getNumerosecuritesociale(): ?string
  227.     {
  228.         return $this->numerosecuritesociale;
  229.     }
  230.     public function setNumerosecuritesociale(string $numerosecuritesociale): self
  231.     {
  232.         $this->numerosecuritesociale $numerosecuritesociale;
  233.         return $this;
  234.     }
  235.     public function getSpecialisation(): ?string
  236.     {
  237.         return $this->specialisation;
  238.     }
  239.     public function setSpecialisation(?string $specialisation): self
  240.     {
  241.         $this->specialisation $specialisation;
  242.         return $this;
  243.     }
  244.     public function getTitre(): ?string
  245.     {
  246.         return $this->titre;
  247.     }
  248.     public function setTitre(?string $titre): self
  249.     {
  250.         $this->titre $titre;
  251.         return $this;
  252.     }
  253.     public function getQualite(): ?string
  254.     {
  255.         return $this->qualite;
  256.     }
  257.     public function setQualite(?string $qualite): self
  258.     {
  259.         $this->qualite $qualite;
  260.         return $this;
  261.     }
  262.     public function getExperience(): ?string
  263.     {
  264.         return $this->experience;
  265.     }
  266.     public function setExperience(?string $experience): self
  267.     {
  268.         $this->experience $experience;
  269.         return $this;
  270.     }
  271.     /**
  272.      * @return Collection<int, FactureFormateur>
  273.      */
  274.     public function getFactureFormateurs(): Collection
  275.     {
  276.         return $this->factureFormateurs;
  277.     }
  278.     public function addFactureFormateur(FactureFormateur $factureFormateur): self
  279.     {
  280.         if (!$this->factureFormateurs->contains($factureFormateur)) {
  281.             $this->factureFormateurs[] = $factureFormateur;
  282.             $factureFormateur->setFormateur($this);
  283.         }
  284.         return $this;
  285.     }
  286.     public function removeFactureFormateur(FactureFormateur $factureFormateur): self
  287.     {
  288.         if ($this->factureFormateurs->removeElement($factureFormateur)) {
  289.             // set the owning side to null (unless already changed)
  290.             if ($factureFormateur->getFormateur() === $this) {
  291.                 $factureFormateur->setFormateur(null);
  292.             }
  293.         }
  294.         return $this;
  295.     }
  296.     public function getSessions(FormateurRepository $formateurRepository)
  297.     {
  298.         return $formateurRepository->getFormateurSessions($this->getId());
  299.     }
  300.     /**
  301.      * @return Collection<int, Emargement>
  302.      */
  303.     public function getEmargements(): Collection
  304.     {
  305.         return $this->emargements;
  306.     }
  307.     public function addEmargement(Emargement $emargement): self
  308.     {
  309.         if (!$this->emargements->contains($emargement)) {
  310.             $this->emargements[] = $emargement;
  311.             $emargement->setFormateur($this);
  312.         }
  313.         return $this;
  314.     }
  315.     public function removeEmargement(Emargement $emargement): self
  316.     {
  317.         if ($this->emargements->removeElement($emargement)) {
  318.             // set the owning side to null (unless already changed)
  319.             if ($emargement->getFormateur() === $this) {
  320.                 $emargement->setFormateur(null);
  321.             }
  322.         }
  323.         return $this;
  324.     }
  325.     /**
  326.      * @return Collection<int, FicheSuivieStagiaireTfpaps>
  327.      */
  328.     public function getFicheSuivieStagiaireTfpaps(): Collection
  329.     {
  330.         return $this->ficheSuivieStagiaireTfpaps;
  331.     }
  332.     public function addFicheSuivieStagiaireTfpap(FicheSuivieStagiaireTfpaps $ficheSuivieStagiaireTfpap): self
  333.     {
  334.         if (!$this->ficheSuivieStagiaireTfpaps->contains($ficheSuivieStagiaireTfpap)) {
  335.             $this->ficheSuivieStagiaireTfpaps[] = $ficheSuivieStagiaireTfpap;
  336.             $ficheSuivieStagiaireTfpap->setFormateur($this);
  337.         }
  338.         return $this;
  339.     }
  340.     public function removeFicheSuivieStagiaireTfpap(FicheSuivieStagiaireTfpaps $ficheSuivieStagiaireTfpap): self
  341.     {
  342.         if ($this->ficheSuivieStagiaireTfpaps->removeElement($ficheSuivieStagiaireTfpap)) {
  343.             // set the owning side to null (unless already changed)
  344.             if ($ficheSuivieStagiaireTfpap->getFormateur() === $this) {
  345.                 $ficheSuivieStagiaireTfpap->setFormateur(null);
  346.             }
  347.         }
  348.         return $this;
  349.     }
  350.     /**
  351.      * @return Collection<int, FicheSuivieStagiaireCqpDssp>
  352.      */
  353.     public function getFicheSuivieStagiaireCqpDssps(): Collection
  354.     {
  355.         return $this->ficheSuivieStagiaireCqpDssps;
  356.     }
  357.     public function addFicheSuivieStagiaireCqpDssp(FicheSuivieStagiaireCqpDssp $ficheSuivieStagiaireCqpDssp): self
  358.     {
  359.         if (!$this->ficheSuivieStagiaireCqpDssps->contains($ficheSuivieStagiaireCqpDssp)) {
  360.             $this->ficheSuivieStagiaireCqpDssps[] = $ficheSuivieStagiaireCqpDssp;
  361.             $ficheSuivieStagiaireCqpDssp->setFormateur($this);
  362.         }
  363.         return $this;
  364.     }
  365.     public function removeFicheSuivieStagiaireCqpDssp(FicheSuivieStagiaireCqpDssp $ficheSuivieStagiaireCqpDssp): self
  366.     {
  367.         if ($this->ficheSuivieStagiaireCqpDssps->removeElement($ficheSuivieStagiaireCqpDssp)) {
  368.             // set the owning side to null (unless already changed)
  369.             if ($ficheSuivieStagiaireCqpDssp->getFormateur() === $this) {
  370.                 $ficheSuivieStagiaireCqpDssp->setFormateur(null);
  371.             }
  372.         }
  373.         return $this;
  374.     }
  375. }