<?phpnamespace App\Entity;use App\Repository\FournisseurRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: FournisseurRepository::class)]class Fournisseur implements \Stringable{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'string', length: 255, nullable: true)] private $name; #[ORM\Column(type: 'boolean', nullable: true)] private $active; #[ORM\Column(type: 'string', length: 255, nullable: true)] private $code_fournisseur; #[ORM\Column(type: 'boolean', nullable: true)] private $non_jde; #[ORM\OneToMany(targetEntity: User::class, mappedBy: 'fournisseur')] private $users; public function __construct() { $this->users = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function __toString(): string { return (string) $this->name; } public function getName(): ?string { return $this->name; } public function setName(?string $name): self { $this->name = $name; return $this; } public function getActive(): ?bool { return $this->active; } public function setActive(?bool $active): self { $this->active = $active; return $this; } public function getCodeFournisseur(): ?string { return $this->code_fournisseur; } public function setCodeFournisseur(?string $code_fournisseur): self { $this->code_fournisseur = $code_fournisseur; return $this; } public function getNonJde(): ?bool { return $this->non_jde; } public function setNonJde(?bool $non_jde): self { $this->non_jde = $non_jde; return $this; } /** * @return Collection|User[] */ public function getUsers(): Collection { return $this->users; } public function addUser(User $user): self { if (!$this->users->contains($user)) { $this->users[] = $user; $user->setFournisseur($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->getFournisseur() === $this) { $user->setFournisseur(null); } } return $this; }}