src/Entity/Client.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClientRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassClientRepository::class)]
  8. class Client
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255nullabletrue)]
  15.     private $societe;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private $contactNom;
  18.     #[ORM\Column(type'string'length255nullabletrue)]
  19.     private $contactPrenom;
  20.     #[ORM\Column(type'string'length255nullabletrue)]
  21.     private $telephone;
  22.     #[ORM\Column(type'string'length255nullabletrue)]
  23.     private $email;
  24.     #[ORM\Column(type'text'nullabletrue)]
  25.     private $adresse;
  26.     #[ORM\Column(type'string'length255nullabletrue)]
  27.     private $codePostal;
  28.     #[ORM\Column(type'string'length255nullabletrue)]
  29.     private $ville;
  30.     #[ORM\Column(type'text'nullabletrue)]
  31.     private $remarques;
  32.     #[ORM\OneToMany(targetEntityAffaire::class, mappedBy'client'cascade: ['persist'])]
  33.     private $affaires;
  34.     #[ORM\ManyToOne(targetEntityTypeClient::class, inversedBy'clients')]
  35.     private $type;
  36.     public function __construct()
  37.     {
  38.         $this->affaires = new ArrayCollection();
  39.     }
  40.     public function __toString()
  41.     {
  42.         $societe=$this->getSociete();
  43.         if(!$societe){$societe="non renseigné";}
  44.         return $societe;
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getSociete(): ?string
  51.     {
  52.         return $this->societe;
  53.     }
  54.     public function setSociete(?string $societe): self
  55.     {
  56.         $this->societe $societe;
  57.         return $this;
  58.     }
  59.     public function getContactNom(): ?string
  60.     {
  61.         return $this->contactNom;
  62.     }
  63.     public function setContactNom(?string $contactNom): self
  64.     {
  65.         $this->contactNom $contactNom;
  66.         return $this;
  67.     }
  68.     public function getContactPrenom(): ?string
  69.     {
  70.         return $this->contactPrenom;
  71.     }
  72.     public function setContactPrenom(?string $contactPrenom): self
  73.     {
  74.         $this->contactPrenom $contactPrenom;
  75.         return $this;
  76.     }
  77.     public function getTelephone(): ?string
  78.     {
  79.         return $this->telephone;
  80.     }
  81.     public function setTelephone(?string $telephone): self
  82.     {
  83.         $this->telephone $telephone;
  84.         return $this;
  85.     }
  86.     public function getEmail(): ?string
  87.     {
  88.         return $this->email;
  89.     }
  90.     public function setEmail(?string $email): self
  91.     {
  92.         $this->email $email;
  93.         return $this;
  94.     }
  95.     public function getAdresse(): ?string
  96.     {
  97.         return $this->adresse;
  98.     }
  99.     public function setAdresse(?string $adresse): self
  100.     {
  101.         $this->adresse $adresse;
  102.         return $this;
  103.     }
  104.     public function getCodePostal(): ?string
  105.     {
  106.         return $this->codePostal;
  107.     }
  108.     public function setCodePostal(?string $codePostal): self
  109.     {
  110.         $this->codePostal $codePostal;
  111.         return $this;
  112.     }
  113.     public function getVille(): ?string
  114.     {
  115.         return $this->ville;
  116.     }
  117.     public function setVille(?string $ville): self
  118.     {
  119.         $this->ville $ville;
  120.         return $this;
  121.     }
  122.     public function getRemarques(): ?string
  123.     {
  124.         return $this->remarques;
  125.     }
  126.     public function setRemarques(?string $remarques): self
  127.     {
  128.         $this->remarques $remarques;
  129.         return $this;
  130.     }
  131.     /**
  132.      * @return Collection|Affaire[]
  133.      */
  134.     public function getAffaires(): Collection
  135.     {
  136.         return $this->affaires;
  137.     }
  138.     public function addAffaire(Affaire $affaire): self
  139.     {
  140.         if (!$this->affaires->contains($affaire)) {
  141.             $this->affaires[] = $affaire;
  142.             $affaire->setClient($this);
  143.         }
  144.         return $this;
  145.     }
  146.     public function removeAffaire(Affaire $affaire): self
  147.     {
  148.         if ($this->affaires->removeElement($affaire)) {
  149.             // set the owning side to null (unless already changed)
  150.             if ($affaire->getClient() === $this) {
  151.                 $affaire->setClient(null);
  152.             }
  153.         }
  154.         return $this;
  155.     }
  156.     public function getType(): ?TypeClient
  157.     {
  158.         return $this->type;
  159.     }
  160.     public function setType(?TypeClient $type): self
  161.     {
  162.         $this->type $type;
  163.         return $this;
  164.     }
  165.    
  166. }