|
@@ -1,84 +1,143 @@
|
|
|
<?php
|
|
<?php
|
|
|
declare(strict_types=1);
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
-namespace App\ApiResources\Public;
|
|
|
|
|
|
|
+namespace App\Entity\Public;
|
|
|
|
|
|
|
|
-use ApiPlatform\Core\Annotation\ApiProperty;
|
|
|
|
|
use ApiPlatform\Core\Annotation\ApiResource;
|
|
use ApiPlatform\Core\Annotation\ApiResource;
|
|
|
-use App\ApiResources\ApiResourcesInterface;
|
|
|
|
|
|
|
+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
|
|
* 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
|
|
|
*/
|
|
*/
|
|
|
|
|
+#[ORM\Entity(repositoryClass: FederationStructureRepository::class, readOnly: true)]
|
|
|
|
|
+#[ORM\Table(name: "view_federation_structures")]
|
|
|
#[ApiResource(
|
|
#[ApiResource(
|
|
|
collectionOperations: [
|
|
collectionOperations: [
|
|
|
'get' => [
|
|
'get' => [
|
|
|
'method' => 'GET',
|
|
'method' => 'GET',
|
|
|
- 'path' => '/public/federation_structures' // required query : '?parent={\d+}'
|
|
|
|
|
|
|
+ 'path' => '/public/federation_structures', // required query : '?parent={\d+}'
|
|
|
|
|
+ 'normalization_context' => ['groups' => ['federation_structure_collection_get']],
|
|
|
]
|
|
]
|
|
|
],
|
|
],
|
|
|
itemOperations: [
|
|
itemOperations: [
|
|
|
'get' => [
|
|
'get' => [
|
|
|
'method' => 'GET',
|
|
'method' => 'GET',
|
|
|
'path' => '/public/federation_structures/{id}',
|
|
'path' => '/public/federation_structures/{id}',
|
|
|
- 'requirements' => ['id' => '\d+']
|
|
|
|
|
|
|
+ 'requirements' => ['id' => '\d+'],
|
|
|
|
|
+ 'normalization_context' => ['groups' => ['federation_structure_item_get']]
|
|
|
]
|
|
]
|
|
|
]
|
|
]
|
|
|
)]
|
|
)]
|
|
|
-class FederationStructure implements ApiResourcesInterface
|
|
|
|
|
|
|
+class FederationStructure
|
|
|
{
|
|
{
|
|
|
- #[ApiProperty(identifier: true)]
|
|
|
|
|
|
|
+ #[ORM\Id]
|
|
|
|
|
+ #[ORM\Column]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get", "federation_structure_collection_get"])]
|
|
|
private int $id;
|
|
private int $id;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get", "federation_structure_collection_get"])]
|
|
|
private ?string $name;
|
|
private ?string $name;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'integer')]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get", "federation_structure_collection_get"])]
|
|
|
private ?int $logoId;
|
|
private ?int $logoId;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get"])]
|
|
|
private ?string $description;
|
|
private ?string $description;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'integer')]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get"])]
|
|
|
private ?int $imageId;
|
|
private ?int $imageId;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get", "federation_structure_collection_get"])]
|
|
|
private ?string $principalType;
|
|
private ?string $principalType;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get", "federation_structure_collection_get"])]
|
|
|
private ?string $website;
|
|
private ?string $website;
|
|
|
|
|
|
|
|
- private string $addresses;
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'json')]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get", "federation_structure_collection_get"])]
|
|
|
|
|
+ private array $addresses;
|
|
|
|
|
|
|
|
- private ?string $telphone;
|
|
|
|
|
|
|
+ #[ORM\Column]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get"])]
|
|
|
|
|
+ private ?string $phone;
|
|
|
|
|
|
|
|
- private ?string $mobilPhone;
|
|
|
|
|
|
|
+ #[ORM\Column]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get"])]
|
|
|
|
|
+ private ?string $mobilePhone;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get"])]
|
|
|
private ?string $email;
|
|
private ?string $email;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get"])]
|
|
|
private ?string $facebook;
|
|
private ?string $facebook;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get"])]
|
|
|
private ?string $twitter;
|
|
private ?string $twitter;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get"])]
|
|
|
private ?string $instagram;
|
|
private ?string $instagram;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get"])]
|
|
|
private ?string $youtube;
|
|
private ?string $youtube;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'json')]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get"])]
|
|
|
private ?array $articles;
|
|
private ?array $articles;
|
|
|
|
|
|
|
|
- private ?string $practices;
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'simple_array')]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get", "federation_structure_collection_get"])]
|
|
|
|
|
+ private ?array $practices;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'float')]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get", "federation_structure_collection_get"])]
|
|
|
private ?float $latitude;
|
|
private ?float $latitude;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'float')]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get", "federation_structure_collection_get"])]
|
|
|
private ?float $longitude;
|
|
private ?float $longitude;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'integer')]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get"])]
|
|
|
private ?int $n1Id;
|
|
private ?int $n1Id;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'integer')]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get"])]
|
|
|
private ?string $n1Name;
|
|
private ?string $n1Name;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'integer')]
|
|
|
|
|
+ #[Groups(["federation_structure_collection_get"])]
|
|
|
private ?int $n2Id;
|
|
private ?int $n2Id;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'integer')]
|
|
|
|
|
+ #[Groups(["federation_structure_collection_get"])]
|
|
|
private ?int $n3Id;
|
|
private ?int $n3Id;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'integer')]
|
|
|
|
|
+ #[Groups(["federation_structure_collection_get"])]
|
|
|
private ?int $n4Id;
|
|
private ?int $n4Id;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'integer')]
|
|
|
|
|
+ #[Groups(["federation_structure_collection_get"])]
|
|
|
private ?int $n5Id;
|
|
private ?int $n5Id;
|
|
|
|
|
|
|
|
- private ?string $parents;
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'simple_array')]
|
|
|
|
|
+ #[Groups(["federation_structure_item_get", "federation_structure_collection_get"])]
|
|
|
|
|
+ private array $parents;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @return int
|
|
* @return int
|
|
@@ -210,18 +269,18 @@ class FederationStructure implements ApiResourcesInterface
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @return string|null
|
|
|
|
|
|
|
+ * @return array
|
|
|
*/
|
|
*/
|
|
|
- public function getAddresses(): ?string
|
|
|
|
|
|
|
+ public function getAddresses(): array
|
|
|
{
|
|
{
|
|
|
return $this->addresses;
|
|
return $this->addresses;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @param string|null $addresses
|
|
|
|
|
|
|
+ * @param array $addresses
|
|
|
* @return FederationStructure
|
|
* @return FederationStructure
|
|
|
*/
|
|
*/
|
|
|
- public function setAddresses(?string $addresses): self
|
|
|
|
|
|
|
+ public function setAddresses(array $addresses): self
|
|
|
{
|
|
{
|
|
|
$this->addresses = $addresses;
|
|
$this->addresses = $addresses;
|
|
|
return $this;
|
|
return $this;
|
|
@@ -230,36 +289,36 @@ class FederationStructure implements ApiResourcesInterface
|
|
|
/**
|
|
/**
|
|
|
* @return string|null
|
|
* @return string|null
|
|
|
*/
|
|
*/
|
|
|
- public function getTelphone(): ?string
|
|
|
|
|
|
|
+ public function getPhone(): ?string
|
|
|
{
|
|
{
|
|
|
- return $this->telphone;
|
|
|
|
|
|
|
+ return $this->phone;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @param string|null $telphone
|
|
|
|
|
|
|
+ * @param string|null $phone
|
|
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
*/
|
|
|
- public function setTelphone(?string $telphone): self
|
|
|
|
|
|
|
+ public function setPhone(?string $phone): self
|
|
|
{
|
|
{
|
|
|
- $this->telphone = $telphone;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ $this->phone = $phone;
|
|
|
return $this;
|
|
return $this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @return string|null
|
|
* @return string|null
|
|
|
*/
|
|
*/
|
|
|
- public function getMobilPhone(): ?string
|
|
|
|
|
|
|
+ public function getMobilePhone(): ?string
|
|
|
{
|
|
{
|
|
|
- return $this->mobilPhone;
|
|
|
|
|
|
|
+ return $this->mobilePhone;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @param string|null $mobilPhone
|
|
|
|
|
|
|
+ * @param string|null $mobilePhone
|
|
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
*/
|
|
|
- public function setMobilPhone(?string $mobilPhone): self
|
|
|
|
|
|
|
+ public function setMobilePhone(?string $mobilePhone): self
|
|
|
{
|
|
{
|
|
|
- $this->mobilPhone = $mobilPhone;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ $this->mobilePhone = $mobilePhone;
|
|
|
return $this;
|
|
return $this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -364,27 +423,27 @@ class FederationStructure implements ApiResourcesInterface
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @param array|null $articles
|
|
* @param array|null $articles
|
|
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
*/
|
|
|
public function setArticles(?array $articles): self
|
|
public function setArticles(?array $articles): self
|
|
|
{
|
|
{
|
|
|
$this->articles = $articles;
|
|
$this->articles = $articles;
|
|
|
-
|
|
|
|
|
return $this;
|
|
return $this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @return string|null
|
|
|
|
|
|
|
+ * @return array|null
|
|
|
*/
|
|
*/
|
|
|
- public function getPractices(): ?string
|
|
|
|
|
|
|
+ public function getPractices(): ?array
|
|
|
{
|
|
{
|
|
|
return $this->practices;
|
|
return $this->practices;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @param string|null $practices
|
|
|
|
|
|
|
+ * @param array|null $practices
|
|
|
* @return FederationStructure
|
|
* @return FederationStructure
|
|
|
*/
|
|
*/
|
|
|
- public function setPractices(?string $practices): self
|
|
|
|
|
|
|
+ public function setPractices(?array $practices): self
|
|
|
{
|
|
{
|
|
|
$this->practices = $practices;
|
|
$this->practices = $practices;
|
|
|
return $this;
|
|
return $this;
|
|
@@ -535,18 +594,18 @@ class FederationStructure implements ApiResourcesInterface
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @return string|null
|
|
|
|
|
|
|
+ * @return array
|
|
|
*/
|
|
*/
|
|
|
- public function getParents(): ?string
|
|
|
|
|
|
|
+ public function getParents(): array
|
|
|
{
|
|
{
|
|
|
return $this->parents;
|
|
return $this->parents;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @param string|null $parents
|
|
|
|
|
|
|
+ * @param array $parents
|
|
|
* @return FederationStructure
|
|
* @return FederationStructure
|
|
|
*/
|
|
*/
|
|
|
- public function setParents(?string $parents): self
|
|
|
|
|
|
|
+ public function setParents(array $parents): self
|
|
|
{
|
|
{
|
|
|
$this->parents = $parents;
|
|
$this->parents = $parents;
|
|
|
return $this;
|
|
return $this;
|