<?php
namespace App\Entity;
use App\Repository\TrClientRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity(repositoryClass=TrClientRepository::class)
* @UniqueEntity(fields={"email"}, message="Cet e-mail est déjà utilisé !")
*/
class TrClient
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $FulName;
/**
* @ORM\Column(type="string", length=255)
*/
private $email;
/**
* @ORM\Column(type="string", length=255)
*/
private $password;
/**
* @Assert\EqualTo(propertyPath="password", message="Les mots de passe ne correspondent pas")
*/
public $Confirmation;
/**
* @ORM\OneToMany(targetEntity=TrDetailsVente::class, mappedBy="Client")
*/
private $trDetailsVentes;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $Active;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $telephone;
public function __construct()
{
$this->trDetailsVentes = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getFulName(): ?string
{
return $this->FulName;
}
public function setFulName(string $FulName): self
{
$this->FulName = $FulName;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getPassword(): ?string
{
return $this->password;
}
public function setPassword(string $password): self
{
$this->password = $password;
return $this;
}
/**
* @return Collection<int, TrDetailsVente>
*/
public function getTrDetailsVentes(): Collection
{
return $this->trDetailsVentes;
}
public function addTrDetailsVente(TrDetailsVente $trDetailsVente): self
{
if (!$this->trDetailsVentes->contains($trDetailsVente)) {
$this->trDetailsVentes[] = $trDetailsVente;
$trDetailsVente->setClient($this);
}
return $this;
}
public function removeTrDetailsVente(TrDetailsVente $trDetailsVente): self
{
if ($this->trDetailsVentes->removeElement($trDetailsVente)) {
// set the owning side to null (unless already changed)
if ($trDetailsVente->getClient() === $this) {
$trDetailsVente->setClient(null);
}
}
return $this;
}
public function __toString()
{
return $this->FulName;
}
public function isActive(): ?bool
{
return $this->Active;
}
public function setActive(?bool $Active): self
{
$this->Active = $Active;
return $this;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone(?string $telephone): self
{
$this->telephone = $telephone;
return $this;
}
}