src/Entity/Fonction.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FonctionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=FonctionRepository::class)
  9.  */
  10. class Fonction
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $wording;
  22.     /**
  23.      * @ORM\Column(type="boolean")
  24.      */
  25.     private $canread;
  26.     /**
  27.      * @ORM\Column(type="boolean")
  28.      */
  29.     private $canwrite;
  30.     /**
  31.      * @ORM\ManyToMany(targetEntity=Role::class, inversedBy="fonctions")
  32.      */
  33.     private $role;
  34.     public function __construct()
  35.     {
  36.         $this->role = new ArrayCollection();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getWording(): ?string
  43.     {
  44.         return $this->wording;
  45.     }
  46.     public function setWording(string $wording): self
  47.     {
  48.         $this->wording $wording;
  49.         return $this;
  50.     }
  51.     public function isCanread(): ?bool
  52.     {
  53.         return $this->canread;
  54.     }
  55.     public function setCanread(bool $canread): self
  56.     {
  57.         $this->canread $canread;
  58.         return $this;
  59.     }
  60.     public function isCanwrite(): ?bool
  61.     {
  62.         return $this->canwrite;
  63.     }
  64.     public function setCanwrite(bool $canwrite): self
  65.     {
  66.         $this->canwrite $canwrite;
  67.         return $this;
  68.     }
  69.     /**
  70.      * @return Collection<int, Role>
  71.      */
  72.     public function getRole(): Collection
  73.     {
  74.         return $this->role;
  75.     }
  76.     public function addRole(Role $role): self
  77.     {
  78.         if (!$this->role->contains($role)) {
  79.             $this->role[] = $role;
  80.         }
  81.         return $this;
  82.     }
  83.     public function removeRole(Role $role): self
  84.     {
  85.         $this->role->removeElement($role);
  86.         return $this;
  87.     }
  88. }