| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- declare (strict_types=1);
- namespace App\ApiResources\Access;
- use ApiPlatform\Metadata\Put;
- use ApiPlatform\Metadata\Get;
- use ApiPlatform\Metadata\ApiResource;
- use ApiPlatform\Metadata\ApiProperty;
- use App\ApiResources\ApiResourcesInterface;
- use App\State\Processor\Access\AdminAccessProcessor;
- use App\State\Provider\Access\AdminAccessProvider;
- use JetBrains\PhpStorm\Pure;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * Classe resource qui contient les champs d'un compte admin
- */
- #[ApiResource]
- class AdminAccess implements ApiResourcesInterface
- {
- #[ApiProperty(identifier: true)]
- public ?int $id = null;
- private ?string $username = null;
- #[Assert\Email(message: 'invalid-email-format', mode: 'strict')]
- private ?string $email = null;
- #[Pure]
- public function __construct()
- {
- }
- public function getId() : ?int
- {
- return $this->id;
- }
- public function setId(?int $id) : self
- {
- $this->id = $id;
- return $this;
- }
- public function getUsername() : ?string
- {
- return $this->username;
- }
- public function setUsername(?string $username) : self
- {
- $this->username = $username;
- return $this;
- }
- public function getEmail() : ?string
- {
- return $this->email;
- }
- public function setEmail(?string $email) : self
- {
- $this->email = $email;
- return $this;
- }
- }
|