| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <?php
- declare(strict_types=1);
- namespace App\ApiResources\HelloAsso;
- use ApiPlatform\Metadata\ApiProperty;
- use ApiPlatform\Metadata\ApiResource;
- use ApiPlatform\Metadata\Get;
- use ApiPlatform\Metadata\GetCollection;
- use ApiPlatform\Metadata\Link;
- use App\State\Provider\HelloAsso\AuthUrlProvider;
- use App\State\Provider\HelloAsso\HelloAssoProfileProvider;
- use App\State\Provider\HelloAsso\EventFormProvider;
- /**
- * Retourne les formulaires d'une organisation.
- */
- #[ApiResource(
- operations: [
- new GetCollection(
- uriTemplate: '/helloasso/forms',
- ),
- new Get(
- uriTemplate: '/helloasso/form/{slug}',
- ),
- new Get(
- uriTemplate: '/public/helloasso/form/by-event/{eventId}',
- uriVariables: [
- 'eventId' => new Link(
- fromProperty: 'eventId',
- identifiers: ['eventId']
- )
- ]
- )
- ],
- provider: EventFormProvider::class,
- )]
- class EventForm
- {
- /**
- * Slug du formulaire
- */
- #[ApiProperty(identifier: true)]
- private ?string $slug = null;
- /**
- * Id de l'Event auquel le formulaire est associé
- * @var int | null
- */
- private ?int $eventId = null;
- /**
- * Titre du formulaire
- * @var string|null
- */
- private ?string $title = null;
- /**
- * Url du formulaire
- */
- private ?string $widgetUrl = null;
- public function getSlug(): ?string
- {
- return $this->slug;
- }
- public function setSlug(?string $slug): self
- {
- $this->slug = $slug;
- return $this;
- }
- public function getEventId(): ?int
- {
- return $this->eventId;
- }
- public function setEventId(?int $eventId): self
- {
- $this->eventId = $eventId;
- return $this;
- }
- public function getTitle(): ?string
- {
- return $this->title;
- }
- public function setTitle(?string $title): self
- {
- $this->title = $title;
- return $this;
- }
- public function getWidgetUrl(): ?string
- {
- return $this->widgetUrl;
- }
- public function setWidgetUrl(?string $widgetUrl): self
- {
- $this->widgetUrl = $widgetUrl;
- return $this;
- }
- }
|