<?php
namespace App\Entity;
use App\Repository\ClientLibreRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ClientLibreRepository::class)
*/
class ClientLibre
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $cl_nom;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $cl_prenom;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $cl_email;
/**
* @ORM\Column(type="string", length=15, nullable=true)
*/
private $cl_telephone;
/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
private $cl_civilite;
/**
* @ORM\OneToMany(targetEntity=Rendezvous::class, mappedBy="client_libre", orphanRemoval=true)
*/
private $rendezvouses;
public function __construct()
{
$this->rendezvouses = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getClNom(): ?string
{
return $this->cl_nom;
}
public function setClNom(string $cl_nom): self
{
$this->cl_nom = strtoupper($cl_nom);
return $this;
}
public function getClPrenom(): ?string
{
return $this->cl_prenom;
}
public function setClPrenom(?string $cl_prenom): self
{
$this->cl_prenom = $cl_prenom?ucfirst($cl_prenom):null;
return $this;
}
public function getClEmail(): ?string
{
return $this->cl_email;
}
public function setClEmail(?string $cl_email): self
{
$this->cl_email = $cl_email;
return $this;
}
public function getClTelephone(): ?string
{
return $this->cl_telephone;
}
public function setClTelephone(?string $cl_telephone): self
{
$this->cl_telephone = $cl_telephone?preg_replace('/\D/', '', $cl_telephone):null;
return $this;
}
public function getClCivilite(): ?string
{
return $this->cl_civilite;
}
public function setClCivilite(?string $cl_civilite): self
{
$this->cl_civilite = $cl_civilite;
return $this;
}
/**
* @return Collection<int, Rendezvous>
*/
public function getRendezvouses(): Collection
{
return $this->rendezvouses;
}
public function addRendezvouse(Rendezvous $rendezvouse): self
{
if (!$this->rendezvouses->contains($rendezvouse)) {
$this->rendezvouses[] = $rendezvouse;
$rendezvouse->setClientLibre($this);
}
return $this;
}
public function removeRendezvouse(Rendezvous $rendezvouse): self
{
if ($this->rendezvouses->removeElement($rendezvouse)) {
// set the owning side to null (unless already changed)
if ($rendezvouse->getClientLibre() === $this) {
$rendezvouse->setClientLibre(null);
}
}
return $this;
}
}