src/Entity/Vendeur.php line 15
<?phpnamespace 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)]#[ORM\UniqueConstraint(name: 'index1',columns: ['id', 'code_vendeur'])]class Vendeur{#[ORM\Id]#[ORM\GeneratedValue]//#[ORM\Column(unique:true)]#[ORM\Column()]private ?int $id = null;#[ORM\Column(nullable:false)]private ?int $code_vendeur = null;#[ORM\Column(length: 250, nullable: true)]private ?string $nom_vendeur = null;#[ORM\OneToMany(mappedBy: 'vendeur', targetEntity: User::class)]private Collection $users;#[ORM\OneToMany(mappedBy: 'vendeur', targetEntity: Statistiques::class)]private Collection $statistiques;public function __construct(){$this->users = new ArrayCollection();$this->statistiques = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function setId(int $id): self{$this->id = $id;return $this;}public function getCodeVendeur(): ?int{return $this->code_vendeur;}public function setCodeVendeur(int $code_vendeur): self{$this->code_vendeur = $code_vendeur;return $this;}public function getNomVendeur(): ?string{return $this->nom_vendeur;}public function setNomVendeur(?string $nom_vendeur): self{$this->nom_vendeur = $nom_vendeur;return $this;}/*** @return Collection<int, User>*/public function getUsers(): Collection{return $this->users;}public function addUser(User $user): self{if (!$this->users->contains($user)) {$this->users->add($user);$user->setVendeur($this);}return $this;}public function removeUser(User $user): self{if ($this->users->removeElement($user)) {// set the owning side to null (unless already changed)if ($user->getVendeur() === $this) {$user->setVendeur(null);}}return $this;}/*** @return Collection<int, Statistiques>*/public function getStatistiques(): Collection{return $this->statistiques;}public function addStatistique(Statistiques $statistique): self{if (!$this->statistiques->contains($statistique)) {$this->statistiques->add($statistique);$statistique->setVendeur($this);}return $this;}public function removeStatistique(Statistiques $statistique): self{if ($this->statistiques->removeElement($statistique)) {// set the owning side to null (unless already changed)if ($statistique->getVendeur() === $this) {$statistique->setVendeur(null);}}return $this;}}