src/Domain/Entity/OfferToken.php line 20

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Domain\Entity;
  4. use ApiPlatform\Metadata\ApiResource;
  5. use ApiPlatform\Metadata\GetCollection;
  6. use App\Domain\Entity\Behavior\Identifiable;
  7. use Gedmo\SoftDeleteable\Traits\SoftDeleteable;
  8. use Gedmo\Timestampable\Traits\Timestampable;
  9. #[ApiResource(
  10.     operations            : [
  11.         new GetCollection(),
  12.     ],
  13.     normalizationContext  : ['groups' => ['offer_token_read']],
  14.     denormalizationContext: ['groups' => ['offer_token_write']]
  15. )]
  16. class OfferToken
  17. {
  18.     use Identifiable;
  19.     use SoftDeleteable;
  20.     use Timestampable;
  21.     public function __construct(
  22.         public string $token,
  23.         public string $name,
  24.     )
  25.     { }
  26.     public function getToken(): string
  27.     {
  28.         return $this->token;
  29.     }
  30.     public function getName(): string
  31.     {
  32.         return $this->name;
  33.     }
  34. }