| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448 |
- <?php
- declare(strict_types=1);
- namespace App\Entity\Public;
- use ApiPlatform\Doctrine\Orm\Filter\BooleanFilter;
- use ApiPlatform\Doctrine\Orm\Filter\NumericFilter;
- use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
- use ApiPlatform\Metadata\ApiFilter;
- use ApiPlatform\Metadata\ApiResource;
- use ApiPlatform\Metadata\Get;
- use ApiPlatform\Metadata\GetCollection;
- use App\Filter\ApiPlatform\Utils\FindInSetFilter;
- use App\Repository\Public\FederationStructureRepository;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Component\Serializer\Annotation\Groups;
- /**
- * Structure telle qu'elle est représentée sur l'iframe de recherche des structures d'une fédération.
- *
- * Fichier source de la view : ./sql/schema-extensions/002-view_federation_structures.sql
- */
- #[ApiResource(
- operations: [
- new Get(
- uriTemplate: '/public/federation_structures/{id}',
- requirements: ['id' => '\\d+'],
- normalizationContext: ['groups' => ['federation_structure_item_get']]
- ),
- new GetCollection(
- uriTemplate: '/public/federation_structures',
- normalizationContext: ['groups' => ['federation_structure_collection_get']]
- ),
- ],
- paginationEnabled: false
- )]
- #[ORM\Entity(repositoryClass: FederationStructureRepository::class, readOnly: true)]
- #[ORM\Table(name: 'view_federation_structures')]
- #[ApiFilter(filterClass: SearchFilter::class, properties: ['name' => 'partial', 'city' => 'exact'])]
- #[ApiFilter(filterClass: NumericFilter::class, properties: ['id', 'parentId'])]
- #[ApiFilter(filterClass: FindInSetFilter::class, properties: ['parents'])]
- #[ApiFilter(filterClass: BooleanFilter::class, properties: ['isFederation', 'portailVisibility'])]
- class FederationStructure
- {
- #[ORM\Id]
- #[ORM\Column]
- #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
- private int $id;
- #[ORM\Column]
- #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
- private string $name;
- #[ORM\Column(type: 'integer', nullable: true)]
- #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
- private ?int $logoId;
- #[ORM\Column(nullable: true)]
- #[Groups(['federation_structure_item_get'])]
- private ?string $description;
- #[ORM\Column(type: 'integer', nullable: true)]
- #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
- private ?int $imageId;
- #[ORM\Column(nullable: true)]
- #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
- private ?string $type;
- #[ORM\Column(options: ['default' => false])]
- #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
- private bool $isFederation = false;
- #[ORM\Column(nullable: true)]
- #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
- private ?string $website;
- /** @var mixed[] */
- #[ORM\Column(type: 'json')]
- #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
- private array $addresses = [];
- #[ORM\Column(nullable: true)]
- #[Groups(['federation_structure_item_get'])]
- private ?string $phone = null;
- #[ORM\Column(nullable: true)]
- #[Groups(['federation_structure_item_get'])]
- private ?string $mobilePhone;
- #[ORM\Column(nullable: true)]
- #[Groups(['federation_structure_item_get'])]
- private ?string $email;
- #[ORM\Column(nullable: true)]
- #[Groups(['federation_structure_item_get'])]
- private ?string $facebook;
- #[ORM\Column(nullable: true)]
- #[Groups(['federation_structure_item_get'])]
- private ?string $twitter;
- #[ORM\Column(nullable: true)]
- #[Groups(['federation_structure_item_get'])]
- private ?string $instagram;
- #[ORM\Column(nullable: true)]
- #[Groups(['federation_structure_item_get'])]
- private ?string $youtube;
- /** @var mixed[]|null */
- #[ORM\Column(type: 'json', nullable: true)]
- #[Groups(['federation_structure_item_get'])]
- private ?array $articles;
- /** @var list<string>|null */
- #[ORM\Column(type: 'simple_array', nullable: true)]
- #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
- private ?array $practices;
- #[ORM\Column(type: 'integer', nullable: true)]
- #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
- private ?int $parentId;
- #[ORM\Column(nullable: true)]
- #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
- private ?string $parentName;
- /** @var list<string> */
- #[ORM\Column(type: 'simple_array')]
- #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
- private array $parents;
- #[ORM\Column(options: ['default' => false])]
- #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
- private bool $portailVisibility = false;
- /** @var mixed[] */
- #[ORM\Column(type: 'json')]
- #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
- private array $sections;
- public function getId(): int
- {
- return $this->id;
- }
- public function setId(int $id): FederationStructure
- {
- $this->id = $id;
- return $this;
- }
- public function getName(): string
- {
- return $this->name;
- }
- public function setName(string $name): FederationStructure
- {
- $this->name = $name;
- return $this;
- }
- public function getLogoId(): ?int
- {
- return $this->logoId;
- }
- public function setLogoId(?int $logoId): FederationStructure
- {
- $this->logoId = $logoId;
- return $this;
- }
- public function getDescription(): ?string
- {
- return $this->description;
- }
- public function setDescription(?string $description): FederationStructure
- {
- $this->description = $description;
- return $this;
- }
- public function getImageId(): ?int
- {
- return $this->imageId;
- }
- public function setImageId(?int $imageId): FederationStructure
- {
- $this->imageId = $imageId;
- return $this;
- }
- public function getType(): ?string
- {
- return $this->type;
- }
- public function setType(?string $type): FederationStructure
- {
- $this->type = $type;
- return $this;
- }
- public function getIsFederation(): bool
- {
- return $this->isFederation;
- }
- public function setIsFederation(bool $isFederation): self
- {
- $this->isFederation = $isFederation;
- return $this;
- }
- public function getWebsite(): ?string
- {
- return $this->website;
- }
- public function setWebsite(?string $website): FederationStructure
- {
- $this->website = $website;
- return $this;
- }
- /**
- * @return mixed[]
- */
- public function getAddresses(): array
- {
- return $this->addresses;
- }
- /**
- * @param mixed[] $addresses
- */
- public function setAddresses(array $addresses): FederationStructure
- {
- $this->addresses = $addresses;
- return $this;
- }
- public function getPhone(): ?string
- {
- return $this->phone;
- }
- public function setPhone(?string $phone): FederationStructure
- {
- $this->phone = $phone;
- return $this;
- }
- public function getMobilePhone(): ?string
- {
- return $this->mobilePhone;
- }
- public function setMobilePhone(?string $mobilePhone): FederationStructure
- {
- $this->mobilePhone = $mobilePhone;
- return $this;
- }
- public function getEmail(): ?string
- {
- return $this->email;
- }
- public function setEmail(?string $email): self
- {
- $this->email = $email;
- return $this;
- }
- public function getFacebook(): ?string
- {
- return $this->facebook;
- }
- public function setFacebook(?string $facebook): self
- {
- $this->facebook = $facebook;
- return $this;
- }
- public function getTwitter(): ?string
- {
- return $this->twitter;
- }
- public function setTwitter(?string $twitter): self
- {
- $this->twitter = $twitter;
- return $this;
- }
- public function getInstagram(): ?string
- {
- return $this->instagram;
- }
- public function setInstagram(?string $instagram): self
- {
- $this->instagram = $instagram;
- return $this;
- }
- public function getYoutube(): ?string
- {
- return $this->youtube;
- }
- public function setYoutube(?string $youtube): FederationStructure
- {
- $this->youtube = $youtube;
- return $this;
- }
- /**
- * @return mixed[]|null
- */
- public function getArticles(): ?array
- {
- return $this->articles;
- }
- /**
- * @param mixed[]|null $articles
- */
- public function setArticles(?array $articles): FederationStructure
- {
- $this->articles = $articles;
- return $this;
- }
- /**
- * @return list<string>|null
- */
- public function getPractices(): ?array
- {
- return $this->practices;
- }
- /**
- * @param list<string>|null $practices
- */
- public function setPractices(?array $practices): FederationStructure
- {
- $this->practices = $practices;
- return $this;
- }
- public function getParentId(): ?int
- {
- return $this->parentId;
- }
- public function setParentId(?int $parentId): FederationStructure
- {
- $this->parentId = $parentId;
- return $this;
- }
- public function getParentName(): ?string
- {
- return $this->parentName;
- }
- public function setParentName(?string $parentName): FederationStructure
- {
- $this->parentName = $parentName;
- return $this;
- }
- /**
- * @return list<string>
- */
- public function getParents(): array
- {
- return $this->parents;
- }
- /**
- * @param list<string> $parents
- */
- public function setParents(array $parents): FederationStructure
- {
- $this->parents = $parents;
- return $this;
- }
- public function getPortailVisibility(): bool
- {
- return $this->portailVisibility;
- }
- public function setPortailVisibility(bool $portailVisibility): FederationStructure
- {
- $this->portailVisibility = $portailVisibility;
- return $this;
- }
- /**
- * @return mixed[]
- */
- public function getSections(): array
- {
- return $this->sections;
- }
- /**
- * @param mixed[] $sections
- */
- public function setSections(array $sections): FederationStructure
- {
- $this->sections = $sections;
- return $this;
- }
- }
|