<?php
namespace App\Entity;
use App\Repository\FilterUseRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Put;
use ApiPlatform\Metadata\Post;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Patch;
use ApiPlatform\Metadata\Delete;
#[ORM\Entity(repositoryClass: FilterUseRepository::class)]
#[ApiResource(
operations: [
new Get(),
new GetCollection(),
new Put(security: "is_granted('ROLE_USER')",),
new Post(security: "is_granted('ROLE_USER')",),
new Patch(security: "is_granted('ROLE_USER')",),
new Delete(security: "is_granted('ROLE_USER')",),
],
)]
#[ApiResource]
class FilterUse
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
#[Groups(['product:read'])]
private ?string $name = null;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: true)]
#[Groups(['product:read'])]
private ?bool $status = null;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getStatus(): ?bool
{
return $this->status;
}
public function setStatus(?bool $status): self
{
$this->status = $status;
return $this;
}
}