src/Domain/Entity/Enumeration/PersonDeleteReason.php line 29

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity\Enumeration;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use ApiPlatform\Metadata\Delete;
  5. use ApiPlatform\Metadata\Get;
  6. use ApiPlatform\Metadata\GetCollection;
  7. use ApiPlatform\Metadata\Post;
  8. use ApiPlatform\Metadata\Put;
  9. use App\Domain\Entity\Enumeration;
  10. /**
  11.  * Class PersonDeleteReason
  12.  *
  13.  * @package App\Domain\Entity\Enumeration
  14.  */
  15. #[ApiResource(
  16.     operations            : [
  17.         new Delete(security"is_granted('ROLE_ADMIN')"),
  18.         new Get(),
  19.         new GetCollection(filters: ['soft_delete_filter']),
  20.         new Post(normalizationContext: ['groups' => ['translations']], security"is_granted('ROLE_ADMIN')"),
  21.         new Put(normalizationContext: ['groups' => ['translations']], security"is_granted('ROLE_ADMIN')"),
  22.     ],
  23.     normalizationContext  : ['groups' => ['enumeration_read']],
  24.     denormalizationContext: ['groups' => ['enumeration_write']]
  25. )]
  26. class PersonDeleteReason extends Enumeration
  27. {
  28.     public const PERSON_DELETE_REASON_OTHER       'person_delete_reason_other';
  29.     public const PERSON_DELETE_REASON_PRIVACY     'person_delete_reason_privacy';
  30.     public const PERSON_DELETE_REASON_SECURITY    'person_delete_reason_security';
  31.     public const PERSON_DELETE_REASON_TEMPORARY   'person_delete_reason_temporary';
  32.     public const PERSON_DELETE_REASON_UNPRACTICAL 'person_delete_reason_unpractical';
  33.     public const PERSON_DELETE_REASON_USELESS     'person_delete_reason_useless';
  34. }