<?phpnamespace App\Entity;use App\Repository\FonctionRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=FonctionRepository::class) */class Fonction{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $wording; /** * @ORM\Column(type="boolean") */ private $canread; /** * @ORM\Column(type="boolean") */ private $canwrite; /** * @ORM\ManyToMany(targetEntity=Role::class, inversedBy="fonctions") */ private $role; public function __construct() { $this->role = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getWording(): ?string { return $this->wording; } public function setWording(string $wording): self { $this->wording = $wording; return $this; } public function isCanread(): ?bool { return $this->canread; } public function setCanread(bool $canread): self { $this->canread = $canread; return $this; } public function isCanwrite(): ?bool { return $this->canwrite; } public function setCanwrite(bool $canwrite): self { $this->canwrite = $canwrite; return $this; } /** * @return Collection<int, Role> */ public function getRole(): Collection { return $this->role; } public function addRole(Role $role): self { if (!$this->role->contains($role)) { $this->role[] = $role; } return $this; } public function removeRole(Role $role): self { $this->role->removeElement($role); return $this; }}