| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <?php
- declare(strict_types=1);
- namespace App\ApiResources\Profile;
- use ApiPlatform\Core\Annotation\ApiProperty;
- use ApiPlatform\Core\Annotation\ApiResource;
- /**
- * Classe resource qui contient les champs disponibles lors d'un appel à my_profile.
- *
- * @ApiResource(
- * collectionOperations={},
- * itemOperations={
- * "get"={
- * "method"="GET",
- * "path"="/my_profile/{id}"
- * }
- * }
- * )
- */
- class AccessProfile
- {
- /**
- * @ApiProperty(identifier=true)
- */
- public $id;
- /**
- * @var string
- */
- private $name;
- /**
- * @var string
- */
- private $givenName;
- /**
- * @var array
- */
- private $roles = [];
- /**
- * @var OrganizationProfile
- */
- private $organization;
- public function __construct()
- {
- }
- public function getId(): ?int
- {
- return $this->id;
- }
- public function setId(?int $id): self
- {
- $this->id = $id;
- return $this;
- }
- public function getOrganization(): ?OrganizationProfile
- {
- return $this->organization;
- }
- public function setOrganization(?OrganizationProfile $organization): self
- {
- $this->organization = $organization;
- return $this;
- }
- public function getName(): ?string
- {
- return $this->name;
- }
- public function setName(?string $name): self
- {
- $this->name = $name;
- return $this;
- }
- public function getGivenName(): ?string
- {
- return $this->givenName;
- }
- public function setGivenName(?string $givenName): self
- {
- $this->givenName = $givenName;
- return $this;
- }
- /**
- * @inheritDoc
- */
- public function getRoles()
- {
- $roles = $this->roles;
- return array_unique($roles);
- }
- public function setRoles(array $roles): self
- {
- $this->roles = $roles;
- return $this;
- }
- }
|