| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- declare(strict_types=1);
- namespace App\ApiResources\Enum;
- use ApiPlatform\Core\Annotation\ApiProperty;
- use ApiPlatform\Core\Annotation\ApiResource;
- /**
- * Classe resource qui contient les champs disponibles lors d'un appel à enum.
- */
- #[ApiResource(
- collectionOperations: [],
- itemOperations: [
- 'get' => [
- 'method' => 'GET',
- 'path' => '/enum/{name}'
- ]
- ]
- )]
- class Enum
- {
- #[ApiProperty(identifier: true)]
- private string $name;
- private array $items = [];
- public function __construct()
- {
- }
- public function getName(): string
- {
- return $this->name;
- }
- public function setName(string $name): self
- {
- $this->name = $name;
- return $this;
- }
- public function setItems(array $items): self
- {
- $this->items = $items;
- return $this;
- }
- public function getItems(): array
- {
- return $this->items;
- }
- }
|