| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- declare (strict_types=1);
- namespace App\ApiResources\Core\File;
- use ApiPlatform\Metadata\ApiProperty;
- use ApiPlatform\Metadata\ApiResource;
- use ApiPlatform\Metadata\Get;
- use App\State\Provider\Core\FileProvider;
- #[ApiResource(
- operations: [
- new Get(
- uriTemplate: 'file/download/{fileId}',
- requirements: ['fileId' => '\\d+'],
- security: 'is_granted("ROLE_FILE")',
- provider: FileProvider::class
- )
- ]
- )]
- class File
- {
- #[ApiProperty(identifier: true)]
- private int $fileId;
- /**
- * @return int
- */
- public function getFileId() : int
- {
- return $this->fileId;
- }
- /**
- * @param int $fileId
- */
- public function setFileId(int $fileId) : void
- {
- $this->fileId = $fileId;
- }
- }
|