| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576 |
- <?php
- declare (strict_types=1);
- namespace App\Entity\Public;
- use ApiPlatform\Metadata\GetCollection;
- use ApiPlatform\Metadata\Get;
- use ApiPlatform\Metadata\ApiResource;
- use ApiPlatform\Doctrine\Orm\Filter\OrderFilter;
- use ApiPlatform\Doctrine\Orm\Filter\DateFilter;
- use ApiPlatform\Doctrine\Orm\Filter\NumericFilter;
- use ApiPlatform\Doctrine\Orm\Filter\RangeFilter;
- use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
- use ApiPlatform\Metadata\ApiFilter;
- use App\Filter\ApiPlatform\Utils\DistanceFilter;
- use App\Repository\Public\PublicEventRepository;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * Évènements publics tels que publiés sur l'agenda du site opentalent ou les sites des structures
- *
- * Fichier source de la view : ./sql/schema-extensions/001-view_public_events.sql
- */
- #[ApiResource(
- operations: [
- new Get(
- uriTemplate: '/public/events/{uuid}'
- ),
- new GetCollection(
- uriTemplate: '/public/events',
- paginationItemsPerPage: 16,
- )
- ]
- )]
- #[ORM\Entity(repositoryClass: PublicEventRepository::class, readOnly: true)]
- #[ORM\Table(name: "view_public_events")]
- #[ApiFilter(filterClass: SearchFilter::class, properties: ['name' => 'partial', 'city' => 'exact'])]
- #[ApiFilter(filterClass: NumericFilter::class, properties: ['organizationId', 'price_mini', 'price_maxi'])]
- #[ApiFilter(filterClass: DateFilter::class, properties: ['datetimeStart', 'datetimeEnd'])]
- #[ApiFilter(filterClass: DistanceFilter::class)]
- #[ApiFilter(filterClass: OrderFilter::class, properties: ['datetimeStart', 'datetimeEnd'], arguments: ['orderParameterName' => 'order'])]
- #[ApiFilter(filterClass: SearchFilter::class, properties: ['origin' => 'exact'])]
- #[ApiFilter(filterClass: RangeFilter::class, properties: ['price_mini', 'price_maxi'])]
- #[ApiFilter(filterClass: SearchFilter::class, properties: ['categoryCode' => 'exact'])]
- class PublicEvent
- {
- #[ORM\Id]
- #[ORM\Column]
- private string $uuid;
- #[ORM\Column(type: 'integer')]
- private ?int $organizationId;
- #[ORM\Column]
- private string $name;
- #[ORM\Column(type: 'string')]
- private ?string $description;
- #[ORM\Column]
- private ?string $url;
- #[ORM\Column(type: 'datetime')]
- private \DateTime $datetimeStart;
- #[ORM\Column(type: 'datetime')]
- private \DateTime $datetimeEnd;
- #[ORM\Column]
- private ?string $city;
- #[ORM\Column]
- private ?string $postalCode;
- #[ORM\Column]
- private ?string $streetAddress;
- #[ORM\Column(type: 'float')]
- private ?float $longitude;
- #[ORM\Column(type: 'float')]
- private ?float $latitude;
- #[ORM\Column]
- private ?string $roomName;
- #[ORM\Column]
- private ?string $roomDescription;
- #[ORM\Column]
- private ?string $roomLocalisation;
- #[ORM\Column]
- private ?string $roomCapacity;
- #[ORM\Column]
- private ?string $roomFloorSize;
- #[ORM\Column]
- private ?string $imageUrl;
- #[ORM\Column]
- private ?string $thumbnailUrl;
- /** @var list<string>|null */
- #[ORM\Column(type: 'simple_array')]
- private ?array $categories;
- #[ORM\Column]
- private string $origin = 'opentalent';
- #[ORM\Column(type: 'integer')]
- private int $entityId;
- #[ORM\Column]
- private int $price_mini;
- #[ORM\Column]
- private int $price_maxi;
- // categoryCode
- #[ORM\Column]
- private ?string $categoryCode;
- /**
- * @return string
- */
- public function getUuid(): string
- {
- return $this->uuid;
- }
- /**
- * @param string $uuid
- * @return PublicEvent
- */
- public function setUuid(string $uuid): PublicEvent
- {
- $this->uuid = $uuid;
- return $this;
- }
- /**
- * @return int|null
- */
- public function getOrganizationId(): ?int
- {
- return $this->organizationId;
- }
- /**
- * @param int|null $organizationId
- * @return PublicEvent
- */
- public function setOrganizationId(?int $organizationId): PublicEvent
- {
- $this->organizationId = $organizationId;
- return $this;
- }
- /**
- * @return string
- */
- public function getName(): string
- {
- return $this->name;
- }
- /**
- * @param string $name
- * @return PublicEvent
- */
- public function setName(string $name): PublicEvent
- {
- $this->name = $name;
- return $this;
- }
- /**
- * @return string|null
- */
- public function getDescription(): ?string
- {
- return $this->description;
- }
- /**
- * @param string|null $description
- * @return PublicEvent
- */
- public function setDescription(?string $description): PublicEvent
- {
- $this->description = $description;
- return $this;
- }
- /**
- * @return string|null
- */
- public function getUrl(): ?string
- {
- return $this->url;
- }
- /**
- * @param string|null $url
- * @return PublicEvent
- */
- public function setUrl(?string $url): PublicEvent
- {
- $this->url = $url;
- return $this;
- }
- /**
- * @return \DateTime
- */
- public function getDatetimeStart(): \DateTime
- {
- return $this->datetimeStart;
- }
- /**
- * @param \DateTime $datetimeStart
- * @return PublicEvent
- */
- public function setDatetimeStart(\DateTime $datetimeStart): PublicEvent
- {
- $this->datetimeStart = $datetimeStart;
- return $this;
- }
- /**
- * @return \DateTime
- */
- public function getDatetimeEnd(): \DateTime
- {
- return $this->datetimeEnd;
- }
- /**
- * @param \DateTime $datetimeEnd
- * @return PublicEvent
- */
- public function setDatetimeEnd(\DateTime $datetimeEnd): PublicEvent
- {
- $this->datetimeEnd = $datetimeEnd;
- return $this;
- }
- /**
- * @return string|null
- */
- public function getCity(): ?string
- {
- return $this->city;
- }
- /**
- * @param string|null $city
- * @return PublicEvent
- */
- public function setCity(?string $city): PublicEvent
- {
- $this->city = $city;
- return $this;
- }
- /**
- * @return string|null
- */
- public function getPostalCode(): ?string
- {
- return $this->postalCode;
- }
- /**
- * @param string|null $postalCode
- * @return PublicEvent
- */
- public function setPostalCode(?string $postalCode): PublicEvent
- {
- $this->postalCode = $postalCode;
- return $this;
- }
- /**
- * @return string|null
- */
- public function getStreetAddress(): ?string
- {
- return $this->streetAddress;
- }
- /**
- * @param string|null $streetAddress
- * @return PublicEvent
- */
- public function setStreetAddress(?string $streetAddress): PublicEvent
- {
- $this->streetAddress = $streetAddress;
- return $this;
- }
- /**
- * @return float|null
- */
- public function getLongitude(): ?float
- {
- return $this->longitude;
- }
- /**
- * @param float|null $longitude
- * @return PublicEvent
- */
- public function setLongitude(?float $longitude): PublicEvent
- {
- $this->longitude = $longitude;
- return $this;
- }
- /**
- * @return float|null
- */
- public function getLatitude(): ?float
- {
- return $this->latitude;
- }
- /**
- * @param float|null $latitude
- * @return PublicEvent
- */
- public function setLatitude(?float $latitude): PublicEvent
- {
- $this->latitude = $latitude;
- return $this;
- }
- /**
- * @return string|null
- */
- public function getRoomName(): ?string
- {
- return $this->roomName;
- }
- /**
- * @param string|null $roomName
- * @return PublicEvent
- */
- public function setRoomName(?string $roomName): PublicEvent
- {
- $this->roomName = $roomName;
- return $this;
- }
- /**
- * @return string|null
- */
- public function getRoomDescription(): ?string
- {
- return $this->roomDescription;
- }
- /**
- * @param string|null $roomDescription
- * @return PublicEvent
- */
- public function setRoomDescription(?string $roomDescription): PublicEvent
- {
- $this->roomDescription = $roomDescription;
- return $this;
- }
- /**
- * @return string|null
- */
- public function getRoomLocalisation(): ?string
- {
- return $this->roomLocalisation;
- }
- /**
- * @param string|null $roomLocalisation
- * @return PublicEvent
- */
- public function setRoomLocalisation(?string $roomLocalisation): PublicEvent
- {
- $this->roomLocalisation = $roomLocalisation;
- return $this;
- }
- /**
- * @return string|null
- */
- public function getRoomCapacity(): ?string
- {
- return $this->roomCapacity;
- }
- /**
- * @param string|null $roomCapacity
- * @return PublicEvent
- */
- public function setRoomCapacity(?string $roomCapacity): PublicEvent
- {
- $this->roomCapacity = $roomCapacity;
- return $this;
- }
- /**
- * @return string|null
- */
- public function getRoomFloorSize(): ?string
- {
- return $this->roomFloorSize;
- }
- /**
- * @param string|null $roomFloorSize
- * @return PublicEvent
- */
- public function setRoomFloorSize(?string $roomFloorSize): PublicEvent
- {
- $this->roomFloorSize = $roomFloorSize;
- return $this;
- }
- /**
- * @return string|null
- */
- public function getImageUrl(): ?string
- {
- return $this->imageUrl;
- }
- /**
- * @param string|null $imageUrl
- * @return PublicEvent
- */
- public function setImageUrl(?string $imageUrl): PublicEvent
- {
- $this->imageUrl = $imageUrl;
- return $this;
- }
- /**
- * @return string|null
- */
- public function getThumbnailUrl(): ?string
- {
- return $this->thumbnailUrl;
- }
- /**
- * @param string|null $thumbnailUrl
- * @return PublicEvent
- */
- public function setThumbnailUrl(?string $thumbnailUrl): PublicEvent
- {
- $this->thumbnailUrl = $thumbnailUrl;
- return $this;
- }
- /**
- * @return list<string>|null
- */
- public function getCategories(): ?array
- {
- return $this->categories;
- }
- /**
- * @param list<string>|null $categories
- * @return PublicEvent
- */
- public function setCategories(?array $categories): PublicEvent
- {
- $this->categories = $categories;
- return $this;
- }
- /**
- * @return string
- */
- public function getOrigin(): string
- {
- return $this->origin;
- }
- /**
- * @param string $origin
- * @return PublicEvent
- */
- public function setOrigin(string $origin): PublicEvent
- {
- $this->origin = $origin;
- return $this;
- }
- /**
- * @return int
- */
- public function getEntityId(): int
- {
- return $this->entityId;
- }
- /**
- * @param int $entityId
- * @return PublicEvent
- */
- public function setEntityId(int $entityId): PublicEvent
- {
- $this->entityId = $entityId;
- return $this;
- }
- /**
- * @return int
- */
- public function getPriceMini(): int
- {
- return $this->price_mini;
- }
- /**
- * @param int $price_mini
- * @return PublicEvent
- */
- public function setPriceMini(int $price_mini): PublicEvent
- {
- $this->price_mini = $price_mini;
- return $this;
- }
- /**
- * @return int
- */
- public function getPriceMaxi(): int
- {
- return $this->price_maxi;
- }
- /**
- * @param int $price_maxi
- * @return PublicEvent
- */
- public function setPriceMaxi(int $price_maxi): PublicEvent
- {
- $this->price_maxi = $price_maxi;
- return $this;
- }
- /**
- * @return string|null
- */
- public function getCategoryCode(): ?string
- {
- return $this->categoryCode;
- }
- /**
- * @param string|null $categoryCode
- * @return PublicEvent
- */
- public function setCategoryCode(?string $categoryCode): PublicEvent
- {
- $this->categoryCode = $categoryCode;
- return $this;
- }
-
- }
|