src/Entity/ProfilDroitPage.php line 14

  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  4. use ApiPlatform\Metadata\ApiFilter;
  5. use ApiPlatform\Metadata\ApiResource;
  6. use App\Repository\ProfilDroitPageRepository;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. #[ORM\Entity(repositoryClassProfilDroitPageRepository::class)]
  10. #[ApiResource]
  11. class ProfilDroitPage
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     #[Groups("role")]
  17.     private ?int $id null;
  18.     #[ORM\ManyToOne(inversedBy'profilDroitPages')]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     #[ApiFilter(SearchFilter::class, strategy'exact')]
  21.     private ?Role $role null;
  22.     #[ORM\ManyToOne(inversedBy'profilDroitPages')]
  23.     #[ORM\JoinColumn(nullablefalse)]
  24.     #[Groups("role")]
  25.     private ?Page $page null;
  26.     #[ORM\Column]
  27.     #[Groups("role")]
  28.     private ?bool $lecture null;
  29.     #[ORM\Column]
  30.     #[Groups("role")]
  31.     private ?bool $ecriture null;
  32.     #[ORM\Column]
  33.     #[Groups("role")]
  34.     private ?bool $suppression null;
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getRole(): ?Role
  40.     {
  41.         return $this->role;
  42.     }
  43.     public function setRole(?Role $role): static
  44.     {
  45.         $this->role $role;
  46.         return $this;
  47.     }
  48.     public function getPage(): ?Page
  49.     {
  50.         return $this->page;
  51.     }
  52.     public function setPage(?Page $page): static
  53.     {
  54.         $this->page $page;
  55.         return $this;
  56.     }
  57.     public function isLecture(): ?bool
  58.     {
  59.         return $this->lecture;
  60.     }
  61.     public function setLecture(bool $lecture): static
  62.     {
  63.         $this->lecture $lecture;
  64.         return $this;
  65.     }
  66.     public function isEcriture(): ?bool
  67.     {
  68.         return $this->ecriture;
  69.     }
  70.     public function setEcriture(bool $ecriture): static
  71.     {
  72.         $this->ecriture $ecriture;
  73.         return $this;
  74.     }
  75.     public function isSuppression(): ?bool
  76.     {
  77.         return $this->suppression;
  78.     }
  79.     public function setSuppression(bool $suppression): static
  80.     {
  81.         $this->suppression $suppression;
  82.         return $this;
  83.     }
  84. }