<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\FormateurRepository")
*/
class Formateur
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $nom;
/**
* @ORM\Column(type="string", length=255)
*/
private $prenom;
/**
* @ORM\Column(type="string", length=255)
*/
private $email;
/**
* @ORM\Column(type="string", length=255)
*/
private $tel;
/**
* @ORM\Column(type="integer")
*/
private $sexe;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $profession;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $image;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Formation", mappedBy="formateur")
*/
private $formations;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
const sexe_long=["Masculin","FĂ©minin"];
public function getFullSexe(){
return self::sexe_long[$this->sexe];
}
public function __construct()
{
$this->formations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getPrenom(): ?string
{
return $this->prenom;
}
public function setPrenom(string $prenom): self
{
$this->prenom = $prenom;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getTel(): ?string
{
return $this->tel;
}
public function setTel(string $tel): self
{
$this->tel = $tel;
return $this;
}
public function getSexe(): ?int
{
return $this->sexe;
}
public function setSexe(int $sexe): self
{
$this->sexe = $sexe;
return $this;
}
public function getProfession(): ?string
{
return $this->profession;
}
public function setProfession(?string $profession): self
{
$this->profession = $profession;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
/**
* @return Collection|Formation[]
*/
public function getFormations(): Collection
{
return $this->formations;
}
public function addFormation(Formation $formation): self
{
if (!$this->formations->contains($formation)) {
$this->formations[] = $formation;
$formation->addFormateur($this);
}
return $this;
}
public function removeFormation(Formation $formation): self
{
if ($this->formations->contains($formation)) {
$this->formations->removeElement($formation);
$formation->removeFormateur($this);
}
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
}