CallbackForwarding.php 880 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\ApiResources\HelloAsso;
  4. use ApiPlatform\Metadata\ApiProperty;
  5. use ApiPlatform\Metadata\ApiResource;
  6. use ApiPlatform\Metadata\Get;
  7. use App\State\Provider\HelloAsso\CallbackForwardingProvider;
  8. /**
  9. * Ressource publique pour gérer les redirections de callback HelloAsso.
  10. */
  11. #[ApiResource(
  12. operations: [
  13. new Get(
  14. uriTemplate: '/public/helloasso/callback',
  15. ),
  16. ],
  17. provider: CallbackForwardingProvider::class,
  18. )]
  19. class CallbackForwarding
  20. {
  21. /**
  22. * Id 'bidon' ajouté par défaut pour permettre la construction
  23. * de l'IRI par api platform.
  24. */
  25. #[ApiProperty(identifier: true)]
  26. private int $id = 1;
  27. public function getId(): int
  28. {
  29. return $this->id;
  30. }
  31. public function setId(int $id): self
  32. {
  33. $this->id = $id;
  34. return $this;
  35. }
  36. }