src/Entity/Options.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\OptionsRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use ApiPlatform\Metadata\Get;
  8. use ApiPlatform\Metadata\Post;
  9. use ApiPlatform\Metadata\Put;
  10. use ApiPlatform\Metadata\Delete;
  11. #[ORM\Entity(repositoryClassOptionsRepository::class)]
  12. #[Get]
  13. #[Put(security"is_granted('ROLE_ADMIN')")]
  14. #[Post(security"is_granted('ROLE_ADMIN')")]
  15. #[Delete(security"is_granted('ROLE_ADMIN')")]
  16. #[ApiResource]
  17. class Options
  18. {
  19.     #[ORM\Id]
  20.     #[ORM\GeneratedValue]
  21.     #[ORM\Column]
  22.     private ?int $id null;
  23.     #[ORM\Column(length100)]
  24.     private ?string $option_key null;
  25.     #[ORM\Column(length255)]
  26.     private ?string $value null;
  27.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  28.     private ?\DateTimeInterface $date null;
  29.     #[ORM\Column(length255)]
  30.     private ?string $name null;
  31.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  32.     private ?string $data null;
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getOptionKey(): ?string
  38.     {
  39.         return $this->option_key;
  40.     }
  41.     public function setOptionKey(string $option_key): self
  42.     {
  43.         $this->option_key $option_key;
  44.         return $this;
  45.     }
  46.     public function getValue(): ?string
  47.     {
  48.         return $this->value;
  49.     }
  50.     public function setValue(string $value): self
  51.     {
  52.         $this->value $value;
  53.         return $this;
  54.     }
  55.     public function getDate(): ?\DateTimeInterface
  56.     {
  57.         return $this->date;
  58.     }
  59.     public function setDate(\DateTimeInterface $date): self
  60.     {
  61.         $this->date $date;
  62.         return $this;
  63.     }
  64.     public function getName(): ?string
  65.     {
  66.         return $this->name;
  67.     }
  68.     public function setName(string $name): self
  69.     {
  70.         $this->name $name;
  71.         return $this;
  72.     }
  73.     public function getData(): ?string
  74.     {
  75.         return $this->data;
  76.     }
  77.     public function setData(?string $data): self
  78.     {
  79.         $this->data $data;
  80.         return $this;
  81.     }
  82. }