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]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $nom null;
  16.     #[ORM\Column(nullabletrue)]
  17.     private ?int $phone null;
  18.     #[ORM\Column(length255nullabletrue)]
  19.     private ?string $adresse null;
  20.     #[ORM\OneToMany(mappedBy'client'targetEntityEcheance::class)]
  21.     private Collection $echeances;
  22.     #[ORM\OneToMany(mappedBy'client'targetEntityVente::class)]
  23.     private Collection $ventes;
  24.     #[ORM\OneToMany(mappedBy'client'targetEntityLivraison::class)]
  25.     private Collection $livraisons;
  26.     #[ORM\OneToMany(mappedBy'client'targetEntityFacture::class)]
  27.     private Collection $facture;
  28.     public function __construct()
  29.     {
  30.         $this->echeances = new ArrayCollection();
  31.         $this->ventes = new ArrayCollection();
  32.         $this->livraisons = new ArrayCollection();
  33.         $this->facture = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getNom(): ?string
  40.     {
  41.         return $this->nom;
  42.     }
  43.     public function setNom(string $nom): static
  44.     {
  45.         $this->nom $nom;
  46.         return $this;
  47.     }
  48.     public function getPhone(): ?int
  49.     {
  50.         return $this->phone;
  51.     }
  52.     public function setPhone(?int $phone): static
  53.     {
  54.         $this->phone $phone;
  55.         return $this;
  56.     }
  57.     public function getAdresse(): ?string
  58.     {
  59.         return $this->adresse;
  60.     }
  61.     public function setAdresse(?string $adresse): static
  62.     {
  63.         $this->adresse $adresse;
  64.         return $this;
  65.     }
  66.     /**
  67.      * @return Collection<int, Echeance>
  68.      */
  69.     public function getEcheances(): Collection
  70.     {
  71.         return $this->echeances;
  72.     }
  73.     public function addEcheance(Echeance $echeance): static
  74.     {
  75.         if (!$this->echeances->contains($echeance)) {
  76.             $this->echeances->add($echeance);
  77.             $echeance->setClient($this);
  78.         }
  79.         return $this;
  80.     }
  81.     public function removeEcheance(Echeance $echeance): static
  82.     {
  83.         if ($this->echeances->removeElement($echeance)) {
  84.             // set the owning side to null (unless already changed)
  85.             if ($echeance->getClient() === $this) {
  86.                 $echeance->setClient(null);
  87.             }
  88.         }
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return Collection<int, Vente>
  93.      */
  94.     public function getVentes(): Collection
  95.     {
  96.         return $this->ventes;
  97.     }
  98.     public function addVente(Vente $vente): static
  99.     {
  100.         if (!$this->ventes->contains($vente)) {
  101.             $this->ventes->add($vente);
  102.             $vente->setClient($this);
  103.         }
  104.         return $this;
  105.     }
  106.     public function removeVente(Vente $vente): static
  107.     {
  108.         if ($this->ventes->removeElement($vente)) {
  109.             // set the owning side to null (unless already changed)
  110.             if ($vente->getClient() === $this) {
  111.                 $vente->setClient(null);
  112.             }
  113.         }
  114.         return $this;
  115.     }
  116.     /**
  117.      * @return Collection<int, Livraison>
  118.      */
  119.     public function getLivraisons(): Collection
  120.     {
  121.         return $this->livraisons;
  122.     }
  123.     public function addLivraison(Livraison $livraison): static
  124.     {
  125.         if (!$this->livraisons->contains($livraison)) {
  126.             $this->livraisons->add($livraison);
  127.             $livraison->setClient($this);
  128.         }
  129.         return $this;
  130.     }
  131.     public function removeLivraison(Livraison $livraison): static
  132.     {
  133.         if ($this->livraisons->removeElement($livraison)) {
  134.             // set the owning side to null (unless already changed)
  135.             if ($livraison->getClient() === $this) {
  136.                 $livraison->setClient(null);
  137.             }
  138.         }
  139.         return $this;
  140.     }
  141.     /**
  142.      * @return Collection<int, Facture>
  143.      */
  144.     public function getFacture(): Collection
  145.     {
  146.         return $this->facture;
  147.     }
  148.     public function addFacture(Facture $facture): static
  149.     {
  150.         if (!$this->facture->contains($facture)) {
  151.             $this->facture->add($facture);
  152.             $facture->setClient($this);
  153.         }
  154.         return $this;
  155.     }
  156.     public function removeFacture(Facture $facture): static
  157.     {
  158.         if ($this->facture->removeElement($facture)) {
  159.             // set the owning side to null (unless already changed)
  160.             if ($facture->getClient() === $this) {
  161.                 $facture->setClient(null);
  162.             }
  163.         }
  164.         return $this;
  165.     }
  166. }