src/Entity/PmMethods.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\PmMethodsRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use ApiPlatform\Metadata\ApiFilter;
  9. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  10. #[ORM\Entity(repositoryClassPmMethodsRepository::class)]
  11. #[ApiResource(
  12.     normalizationContext: ['groups' => ['pm:read']],
  13.     denormalizationContext: ['groups' => ['pm:write']],
  14.     order: ['id' => 'DESC']
  15. )]
  16. #[ApiFilter(SearchFilter::class, properties: [
  17.     'slug' => 'exact'
  18.     'name' => 'partial' 
  19. ])]
  20. class PmMethods
  21. {
  22.     #[Groups(['pm:read''pm:write'])]
  23.     #[ORM\Id]
  24.     #[ORM\GeneratedValue]
  25.     #[ORM\Column]
  26.     private ?int $id null;
  27.     #[Groups(['pm:read''pm:write'])]
  28.     #[ORM\Column(length255nullabletrue)]
  29.     private ?string $name null;
  30.     #[Groups(['pm:read''pm:write'])]
  31.     #[ORM\Column(length50nullabletrue)]
  32.     private ?string $slug null;
  33.     #[Groups(['pm:read''pm:write'])]
  34.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  35.     private ?string $content null;
  36.     #[Groups(['pm:read''pm:write'])]
  37.     #[ORM\Column(nullabletrue)]
  38.     private ?array $object null;
  39.     #[Groups(['pm:read''pm:write'])]
  40.     #[ORM\Column(length255nullabletrue)]
  41.     private ?string $publicKey null;
  42.     #[Groups(['pm:read''pm:write'])]  
  43.     #[ORM\Column(length255nullabletrue)]
  44.     private ?string $privateKey null;
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getName(): ?string
  50.     {
  51.         return $this->name;
  52.     }
  53.     public function setName(?string $name): static
  54.     {
  55.         $this->name $name;
  56.         return $this;
  57.     }
  58.     public function getSlug(): ?string
  59.     {
  60.         return $this->slug;
  61.     }
  62.     public function setSlug(?string $slug): static
  63.     {
  64.         $this->slug $slug;
  65.         return $this;
  66.     }
  67.     public function getContent(): ?string
  68.     {
  69.         return $this->content;
  70.     }
  71.     public function setContent(?string $content): static
  72.     {
  73.         $this->content $content;
  74.         return $this;
  75.     }
  76.     public function getObject(): ?array
  77.     {
  78.         return $this->object;
  79.     }
  80.     public function setObject(?array $object): static
  81.     {
  82.         $this->object $object;
  83.         return $this;
  84.     }
  85.     public function getPublicKey(): ?string
  86.     {
  87.         return $this->publicKey;
  88.     }
  89.     public function setPublicKey(?string $publicKey): static
  90.     {
  91.         $this->publicKey $publicKey;
  92.         return $this;
  93.     }
  94.     public function getPrivateKey(): ?string
  95.     {
  96.         return $this->privateKey;
  97.     }
  98.     public function setPrivateKey(?string $privateKey): static
  99.     {
  100.         $this->privateKey $privateKey;
  101.         return $this;
  102.     }
  103. }