src/Entity/TrClient.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TrClientRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. /**
  10.  * @ORM\Entity(repositoryClass=TrClientRepository::class)
  11.  * @UniqueEntity(fields={"email"}, message="Cet e-mail est déjà utilisé !")
  12.  */
  13. class TrClient
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     private $FulName;
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      */
  28.     private $email;
  29.     /**
  30.      * @ORM\Column(type="string", length=255)
  31.      */
  32.     private $password;
  33.     /**
  34.      * @Assert\EqualTo(propertyPath="password", message="Les mots de passe ne correspondent pas")
  35.      */
  36.     public $Confirmation;
  37.     /**
  38.      * @ORM\OneToMany(targetEntity=TrDetailsVente::class, mappedBy="Client")
  39.      */
  40.     private $trDetailsVentes;
  41.     /**
  42.      * @ORM\Column(type="boolean", nullable=true)
  43.      */
  44.     private $Active;
  45.     /**
  46.      * @ORM\Column(type="string", length=255, nullable=true)
  47.      */
  48.     private $telephone;
  49.     public function __construct()
  50.     {
  51.         $this->trDetailsVentes = new ArrayCollection();
  52.     }
  53.     public function getId(): ?int
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function getFulName(): ?string
  58.     {
  59.         return $this->FulName;
  60.     }
  61.     public function setFulName(string $FulName): self
  62.     {
  63.         $this->FulName = $FulName;
  64.         return $this;
  65.     }
  66.     public function getEmail(): ?string
  67.     {
  68.         return $this->email;
  69.     }
  70.     public function setEmail(string $email): self
  71.     {
  72.         $this->email = $email;
  73.         return $this;
  74.     }
  75.     public function getPassword(): ?string
  76.     {
  77.         return $this->password;
  78.     }
  79.     public function setPassword(string $password): self
  80.     {
  81.         $this->password = $password;
  82.         return $this;
  83.     }
  84.     /**
  85.      * @return Collection<int, TrDetailsVente>
  86.      */
  87.     public function getTrDetailsVentes(): Collection
  88.     {
  89.         return $this->trDetailsVentes;
  90.     }
  91.     public function addTrDetailsVente(TrDetailsVente $trDetailsVente): self
  92.     {
  93.         if (!$this->trDetailsVentes->contains($trDetailsVente)) {
  94.             $this->trDetailsVentes[] = $trDetailsVente;
  95.             $trDetailsVente->setClient($this);
  96.         }
  97.         return $this;
  98.     }
  99.     public function removeTrDetailsVente(TrDetailsVente $trDetailsVente): self
  100.     {
  101.         if ($this->trDetailsVentes->removeElement($trDetailsVente)) {
  102.             // set the owning side to null (unless already changed)
  103.             if ($trDetailsVente->getClient() === $this) {
  104.                 $trDetailsVente->setClient(null);
  105.             }
  106.         }
  107.         return $this;
  108.     }
  109.     public function __toString()
  110.     {
  111.         return $this->FulName;
  112.     }
  113.     public function isActive(): ?bool
  114.     {
  115.         return $this->Active;
  116.     }
  117.     public function setActive(?bool $Active): self
  118.     {
  119.         $this->Active = $Active;
  120.         return $this;
  121.     }
  122.     public function getTelephone(): ?string
  123.     {
  124.         return $this->telephone;
  125.     }
  126.     public function setTelephone(?string $telephone): self
  127.     {
  128.         $this->telephone = $telephone;
  129.         return $this;
  130.     }
  131. }