src\Entity\Formateur.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClass\App\Repository\FormateurRepository::class)]
  7. class Formateur
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     private $id;
  13.     #[ORM\Column(type'string'length255)]
  14.     private $nom;
  15.     #[ORM\Column(type'string'length255)]
  16.     private $prenom;
  17.     #[ORM\Column(type'string'length255)]
  18.     private $email;
  19.     #[ORM\Column(type'string'length255)]
  20.     private $tel;
  21.     #[ORM\Column(type'integer')]
  22.     private $sexe;
  23.     #[ORM\Column(type'string'length255nullabletrue)]
  24.     private $profession;
  25.     #[ORM\Column(type'string'length255nullabletrue)]
  26.     private $image;
  27.     #[ORM\ManyToMany(targetEntity\App\Entity\Formation::class, mappedBy'formateur')]
  28.     private $formations;
  29.     #[ORM\Column(type'text'nullabletrue)]
  30.     private $description;
  31.     const sexe_long=["Masculin","FĂ©minin"];
  32.     public function getFullSexe(){
  33.         return self::sexe_long[$this->sexe];
  34.     }
  35.     public function __construct()
  36.     {
  37.         $this->formations = new ArrayCollection();
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getNom(): ?string
  44.     {
  45.         return $this->nom;
  46.     }
  47.     public function setNom(string $nom): self
  48.     {
  49.         $this->nom $nom;
  50.         return $this;
  51.     }
  52.     public function getPrenom(): ?string
  53.     {
  54.         return $this->prenom;
  55.     }
  56.     public function setPrenom(string $prenom): self
  57.     {
  58.         $this->prenom $prenom;
  59.         return $this;
  60.     }
  61.     public function getEmail(): ?string
  62.     {
  63.         return $this->email;
  64.     }
  65.     public function setEmail(string $email): self
  66.     {
  67.         $this->email $email;
  68.         return $this;
  69.     }
  70.     public function getTel(): ?string
  71.     {
  72.         return $this->tel;
  73.     }
  74.     public function setTel(string $tel): self
  75.     {
  76.         $this->tel $tel;
  77.         return $this;
  78.     }
  79.     public function getSexe(): ?int
  80.     {
  81.         return $this->sexe;
  82.     }
  83.     public function setSexe(int $sexe): self
  84.     {
  85.         $this->sexe $sexe;
  86.         return $this;
  87.     }
  88.     public function getProfession(): ?string
  89.     {
  90.         return $this->profession;
  91.     }
  92.     public function setProfession(?string $profession): self
  93.     {
  94.         $this->profession $profession;
  95.         return $this;
  96.     }
  97.     public function getImage(): ?string
  98.     {
  99.         return $this->image;
  100.     }
  101.     public function setImage(?string $image): self
  102.     {
  103.         $this->image $image;
  104.         return $this;
  105.     }
  106.     /**
  107.      * @return Collection|Formation[]
  108.      */
  109.     public function getFormations(): Collection
  110.     {
  111.         return $this->formations;
  112.     }
  113.     public function addFormation(Formation $formation): self
  114.     {
  115.         if (!$this->formations->contains($formation)) {
  116.             $this->formations[] = $formation;
  117.             $formation->addFormateur($this);
  118.         }
  119.         return $this;
  120.     }
  121.     public function removeFormation(Formation $formation): self
  122.     {
  123.         if ($this->formations->contains($formation)) {
  124.             $this->formations->removeElement($formation);
  125.             $formation->removeFormateur($this);
  126.         }
  127.         return $this;
  128.     }
  129.     public function getDescription(): ?string
  130.     {
  131.         return $this->description;
  132.     }
  133.     public function setDescription(?string $description): self
  134.     {
  135.         $this->description $description;
  136.         return $this;
  137.     }
  138. }