<?php
namespace App\Entity;
use App\Repository\VendeurRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: VendeurRepository::class)]
class Vendeur
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $nomvendeur = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $adresse = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $tel1 = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $tel2 = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $rc = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $mf = null;
#[ORM\OneToMany(mappedBy: 'vendeurs', targetEntity: Devis::class, cascade: ["remove"])]
private Collection $devis;
#[ORM\OneToMany(mappedBy: 'vendeurs', targetEntity: Bondesortie::class)]
private Collection $bondesorties;
public function __construct()
{
$this->devis = new ArrayCollection();
$this->bondesorties = new ArrayCollection();
}
public function __toString()
{
return $this->getNomvendeur(); // Remplacez "getName()" par la méthode ou la propriété appropriée
}
public function getId(): ?int
{
return $this->id;
}
public function getNomvendeur(): ?string
{
return $this->nomvendeur;
}
public function setNomvendeur(?string $nomvendeur): self
{
$this->nomvendeur = $nomvendeur;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(?string $adresse): self
{
$this->adresse = $adresse;
return $this;
}
public function getTel1(): ?string
{
return $this->tel1;
}
public function setTel1(?string $tel1): self
{
$this->tel1 = $tel1;
return $this;
}
public function getTel2(): ?string
{
return $this->tel2;
}
public function setTel2(?string $tel2): self
{
$this->tel2 = $tel2;
return $this;
}
public function getRc(): ?string
{
return $this->rc;
}
public function setRc(?string $rc): self
{
$this->rc = $rc;
return $this;
}
public function getMf(): ?string
{
return $this->mf;
}
public function setMf(?string $mf): self
{
$this->mf = $mf;
return $this;
}
/**
* @return Collection<int, Devis>
*/
public function getDevis(): Collection
{
return $this->devis;
}
public function addDevi(Devis $devi): self
{
if (!$this->devis->contains($devi)) {
$this->devis->add($devi);
$devi->setVendeurs($this);
}
return $this;
}
public function removeDevi(Devis $devi): self
{
if ($this->devis->removeElement($devi)) {
// set the owning side to null (unless already changed)
if ($devi->getVendeurs() === $this) {
$devi->setVendeurs(null);
}
}
return $this;
}
/**
* @return Collection<int, Bondesortie>
*/
public function getBondesorties(): Collection
{
return $this->bondesorties;
}
public function addBondesorty(Bondesortie $bondesorty): self
{
if (!$this->bondesorties->contains($bondesorty)) {
$this->bondesorties->add($bondesorty);
$bondesorty->setVendeurs($this);
}
return $this;
}
public function removeBondesorty(Bondesortie $bondesorty): self
{
if ($this->bondesorties->removeElement($bondesorty)) {
// set the owning side to null (unless already changed)
if ($bondesorty->getVendeurs() === $this) {
$bondesorty->setVendeurs(null);
}
}
return $this;
}
}