<?phpnamespace App\Entity;use App\Repository\ClientRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ClientRepository::class)]class Client{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $nom = null; #[ORM\Column(nullable: true)] private ?int $phone = null; #[ORM\Column(length: 255, nullable: true)] private ?string $adresse = null; #[ORM\OneToMany(mappedBy: 'client', targetEntity: Echeance::class)] private Collection $echeances; #[ORM\OneToMany(mappedBy: 'client', targetEntity: Vente::class)] private Collection $ventes; #[ORM\OneToMany(mappedBy: 'client', targetEntity: Livraison::class)] private Collection $livraisons; #[ORM\OneToMany(mappedBy: 'client', targetEntity: Facture::class)] private Collection $facture; public function __construct() { $this->echeances = new ArrayCollection(); $this->ventes = new ArrayCollection(); $this->livraisons = new ArrayCollection(); $this->facture = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getNom(): ?string { return $this->nom; } public function setNom(string $nom): static { $this->nom = $nom; return $this; } public function getPhone(): ?int { return $this->phone; } public function setPhone(?int $phone): static { $this->phone = $phone; return $this; } public function getAdresse(): ?string { return $this->adresse; } public function setAdresse(?string $adresse): static { $this->adresse = $adresse; return $this; } /** * @return Collection<int, Echeance> */ public function getEcheances(): Collection { return $this->echeances; } public function addEcheance(Echeance $echeance): static { if (!$this->echeances->contains($echeance)) { $this->echeances->add($echeance); $echeance->setClient($this); } return $this; } public function removeEcheance(Echeance $echeance): static { if ($this->echeances->removeElement($echeance)) { // set the owning side to null (unless already changed) if ($echeance->getClient() === $this) { $echeance->setClient(null); } } return $this; } /** * @return Collection<int, Vente> */ public function getVentes(): Collection { return $this->ventes; } public function addVente(Vente $vente): static { if (!$this->ventes->contains($vente)) { $this->ventes->add($vente); $vente->setClient($this); } return $this; } public function removeVente(Vente $vente): static { if ($this->ventes->removeElement($vente)) { // set the owning side to null (unless already changed) if ($vente->getClient() === $this) { $vente->setClient(null); } } return $this; } /** * @return Collection<int, Livraison> */ public function getLivraisons(): Collection { return $this->livraisons; } public function addLivraison(Livraison $livraison): static { if (!$this->livraisons->contains($livraison)) { $this->livraisons->add($livraison); $livraison->setClient($this); } return $this; } public function removeLivraison(Livraison $livraison): static { if ($this->livraisons->removeElement($livraison)) { // set the owning side to null (unless already changed) if ($livraison->getClient() === $this) { $livraison->setClient(null); } } return $this; } /** * @return Collection<int, Facture> */ public function getFacture(): Collection { return $this->facture; } public function addFacture(Facture $facture): static { if (!$this->facture->contains($facture)) { $this->facture->add($facture); $facture->setClient($this); } return $this; } public function removeFacture(Facture $facture): static { if ($this->facture->removeElement($facture)) { // set the owning side to null (unless already changed) if ($facture->getClient() === $this) { $facture->setClient(null); } } return $this; }}