| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- declare(strict_types=1);
- namespace App\ApiResources\Tree;
- use ApiPlatform\Metadata\ApiProperty;
- use ApiPlatform\Metadata\ApiResource;
- use ApiPlatform\Metadata\Get;
- use App\Service\Utils\Tree\BaseResourceTree;
- use App\Service\Utils\Tree\ResourceTreeInterface;
- use App\State\Provider\Tree\TypeOfPracticeTreeProvider;
- #[ApiResource(
- operations: [
- new Get(
- uriTemplate: '/tree/type_of_practices',
- ),
- ],
- provider: TypeOfPracticeTreeProvider::class,
- )]
- class TypeOfPracticeTree extends BaseResourceTree implements ResourceTreeInterface
- {
- /**
- * Id 'bidon' ajouté par défaut pour permettre la construction
- * de l'IRI par api platform.
- */
- #[ApiProperty(identifier: true)]
- private int $id = 1;
- public function getId(): int
- {
- return $this->id;
- }
- public function setId(int $id): self
- {
- $this->id = $id;
- return $this;
- }
- }
|