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