src/Entity/ClientLibre.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClientLibreRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ClientLibreRepository::class)
  9.  */
  10. class ClientLibre
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $cl_nom;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true)
  24.      */
  25.     private $cl_prenom;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $cl_email;
  30.     /**
  31.      * @ORM\Column(type="string", length=15, nullable=true)
  32.      */
  33.     private $cl_telephone;
  34.     /**
  35.      * @ORM\Column(type="string", length=20, nullable=true)
  36.      */
  37.     private $cl_civilite;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity=Rendezvous::class, mappedBy="client_libre", orphanRemoval=true)
  40.      */
  41.     private $rendezvouses;
  42.     public function __construct()
  43.     {
  44.         $this->rendezvouses = new ArrayCollection();
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getClNom(): ?string
  51.     {
  52.         return $this->cl_nom;
  53.     }
  54.     public function setClNom(string $cl_nom): self
  55.     {
  56.         $this->cl_nom strtoupper($cl_nom);
  57.         return $this;
  58.     }
  59.     public function getClPrenom(): ?string
  60.     {
  61.         return $this->cl_prenom;
  62.     }
  63.     public function setClPrenom(?string $cl_prenom): self
  64.     {
  65.         $this->cl_prenom $cl_prenom?ucfirst($cl_prenom):null;
  66.         return $this;
  67.     }
  68.     public function getClEmail(): ?string
  69.     {
  70.         return $this->cl_email;
  71.     }
  72.     public function setClEmail(?string $cl_email): self
  73.     {
  74.         $this->cl_email $cl_email;
  75.         return $this;
  76.     }
  77.     public function getClTelephone(): ?string
  78.     {
  79.         return $this->cl_telephone;
  80.     }
  81.     public function setClTelephone(?string $cl_telephone): self
  82.     {
  83.         $this->cl_telephone $cl_telephone?preg_replace('/\D/'''$cl_telephone):null;
  84.         return $this;
  85.     }
  86.     public function getClCivilite(): ?string
  87.     {
  88.         return $this->cl_civilite;
  89.     }
  90.     public function setClCivilite(?string $cl_civilite): self
  91.     {
  92.         $this->cl_civilite $cl_civilite;
  93.         return $this;
  94.     }
  95.     /**
  96.      * @return Collection<int, Rendezvous>
  97.      */
  98.     public function getRendezvouses(): Collection
  99.     {
  100.         return $this->rendezvouses;
  101.     }
  102.     public function addRendezvouse(Rendezvous $rendezvouse): self
  103.     {
  104.         if (!$this->rendezvouses->contains($rendezvouse)) {
  105.             $this->rendezvouses[] = $rendezvouse;
  106.             $rendezvouse->setClientLibre($this);
  107.         }
  108.         return $this;
  109.     }
  110.     public function removeRendezvouse(Rendezvous $rendezvouse): self
  111.     {
  112.         if ($this->rendezvouses->removeElement($rendezvouse)) {
  113.             // set the owning side to null (unless already changed)
  114.             if ($rendezvouse->getClientLibre() === $this) {
  115.                 $rendezvouse->setClientLibre(null);
  116.             }
  117.         }
  118.         return $this;
  119.     }
  120. }