src/Entity/FilterUse.php line 28

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FilterUseRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. use ApiPlatform\Metadata\ApiResource;
  7. use ApiPlatform\Metadata\Put;
  8. use ApiPlatform\Metadata\Post;
  9. use ApiPlatform\Metadata\Get;
  10. use ApiPlatform\Metadata\GetCollection;
  11. use ApiPlatform\Metadata\Patch;
  12. use ApiPlatform\Metadata\Delete;
  13. #[ORM\Entity(repositoryClassFilterUseRepository::class)]
  14. #[ApiResource(
  15.     operations: [
  16.         new Get(),
  17.         new GetCollection(),
  18.         new Put(security"is_granted('ROLE_USER')",),
  19.         new Post(security"is_granted('ROLE_USER')",),
  20.         new Patch(security"is_granted('ROLE_USER')",),
  21.         new Delete(security"is_granted('ROLE_USER')",),
  22.     ],
  23. )]
  24. #[ApiResource]
  25. class FilterUse
  26. {
  27.     #[ORM\Id]
  28.     #[ORM\GeneratedValue]
  29.     #[ORM\Column(type\Doctrine\DBAL\Types\Types::INTEGER)]
  30.     private ?int $id null;
  31.     #[ORM\Column(type\Doctrine\DBAL\Types\Types::STRINGlength255)]
  32.     #[Groups(['product:read'])]
  33.     private ?string $name null;
  34.     #[ORM\Column(type\Doctrine\DBAL\Types\Types::BOOLEANnullabletrue)]
  35.     #[Groups(['product:read'])]
  36.     private ?bool $status null;
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getName(): ?string
  42.     {
  43.         return $this->name;
  44.     }
  45.     public function setName(string $name): self
  46.     {
  47.         $this->name $name;
  48.         return $this;
  49.     }
  50.     public function getStatus(): ?bool
  51.     {
  52.         return $this->status;
  53.     }
  54.     public function setStatus(?bool $status): self
  55.     {
  56.         $this->status $status;
  57.         return $this;
  58.     }
  59. }