Symfony 6.4 - Update ApiResource Entity classes

- Update imports
- replace annotations with attributes
This commit is contained in:
Clemente Raposo 2024-01-11 17:02:20 +00:00
parent 9749583a26
commit 5e2a39c089
17 changed files with 1135 additions and 901 deletions

View file

@ -26,38 +26,46 @@
*/
namespace App\Themes\Entity;
use ApiPlatform\Core\Annotation\ApiProperty;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GraphQl\Query;
/**
* @ApiResource(
* itemOperations={
* "get"
* },
* collectionOperations={
* },
* graphql={
* "item_query",
* },
* )
*/
#[ApiResource(
operations: [
new Get()
],
graphQlOperations: [
new Query()
]
)]
class ThemeImages
{
/**
* @ApiProperty(identifier=true)
* @var string|null
*/
protected $id;
#[ApiProperty(
identifier: true,
openapiContext: [
'type' => 'string',
'description' => 'The id',
]
)]
protected ?string $id;
/**
* @ApiProperty
* @var array|null
*/
protected $items;
#[ApiProperty(
openapiContext: [
'type' => 'array',
'description' => 'The items',
]
)]
protected ?array $items;
/**
* Get Id