|
|
@@ -1,59 +1,85 @@
|
|
|
<?php
|
|
|
+declare(strict_types=1);
|
|
|
+
|
|
|
namespace App\ApiResources\Public;
|
|
|
|
|
|
use ApiPlatform\Core\Annotation\ApiProperty;
|
|
|
use ApiPlatform\Core\Annotation\ApiResource;
|
|
|
use App\ApiResources\ApiResourcesInterface;
|
|
|
+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
|
|
|
*/
|
|
|
#[ApiResource(
|
|
|
- collectionOperations:[
|
|
|
+ collectionOperations: [
|
|
|
'get' => [
|
|
|
'method' => 'GET',
|
|
|
- 'path' => '/api/public/federation_structures/get?parent-id=${parentId}',
|
|
|
+ 'path' => '/public/federation_structures' // + '?parent={\d+}'
|
|
|
]
|
|
|
],
|
|
|
itemOperations: [
|
|
|
'get' => [
|
|
|
'method' => 'GET',
|
|
|
- 'path' => '/api/public/federation_structures/get?organization-id=${organizationId}',
|
|
|
+ 'path' => '/public/federation_structures/{id}',
|
|
|
+ 'requirements' => ['id' => '\d+']
|
|
|
]
|
|
|
]
|
|
|
)]
|
|
|
class FederationStructure implements ApiResourcesInterface
|
|
|
{
|
|
|
-// n1.parent_id as n1Id, net1.name as n1Name, n2.parent_id as n2Id, n3.parent_id as n3Id, n4.parent_id as n4Id, n5.parent_id as n5Id,
|
|
|
-
|
|
|
#[ApiProperty(identifier: true)]
|
|
|
private int $id;
|
|
|
|
|
|
- private string $name;
|
|
|
+ private ?string $name;
|
|
|
+
|
|
|
+ private ?int $logoId;
|
|
|
|
|
|
- private int $logoId;
|
|
|
+ private ?string $description;
|
|
|
|
|
|
- private string $principalType;
|
|
|
+ private ?int $imageId;
|
|
|
|
|
|
- private string $website;
|
|
|
+ private ?string $principalType;
|
|
|
+
|
|
|
+ private ?string $website;
|
|
|
|
|
|
private string $addresses;
|
|
|
|
|
|
- private string $practices;
|
|
|
+ private ?string $telphone;
|
|
|
+
|
|
|
+ private ?string $mobilPhone;
|
|
|
+
|
|
|
+ private ?string $email;
|
|
|
+
|
|
|
+ private ?string $facebook;
|
|
|
+
|
|
|
+ private ?string $twitter;
|
|
|
+
|
|
|
+ private ?string $instagram;
|
|
|
+
|
|
|
+ private ?string $youtube;
|
|
|
+
|
|
|
+ private ?array $articles;
|
|
|
+
|
|
|
+ private ?string $practices;
|
|
|
|
|
|
- private int $parentId;
|
|
|
+ private ?float $latitude;
|
|
|
|
|
|
- private int $n1Id;
|
|
|
+ private ?float $longitude;
|
|
|
|
|
|
- private int $n2Id;
|
|
|
+ private ?int $n1Id;
|
|
|
|
|
|
- private int $n3Id;
|
|
|
+ private ?string $n1Name;
|
|
|
|
|
|
- private int $n4Id;
|
|
|
+ private ?int $n2Id;
|
|
|
|
|
|
- private int $n5Id;
|
|
|
+ private ?int $n3Id;
|
|
|
|
|
|
- private string $parents;
|
|
|
+ private ?int $n4Id;
|
|
|
+
|
|
|
+ private ?int $n5Id;
|
|
|
+
|
|
|
+ private ?string $parents;
|
|
|
|
|
|
/**
|
|
|
* @return int
|
|
|
@@ -70,7 +96,6 @@ class FederationStructure implements ApiResourcesInterface
|
|
|
public function setId(int $id): self
|
|
|
{
|
|
|
$this->id = $id;
|
|
|
-
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
@@ -84,6 +109,7 @@ class FederationStructure implements ApiResourcesInterface
|
|
|
|
|
|
/**
|
|
|
* @param string $name
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
|
public function setName(string $name): self
|
|
|
{
|
|
|
@@ -93,218 +119,437 @@ class FederationStructure implements ApiResourcesInterface
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return int
|
|
|
+ * @return int|null
|
|
|
*/
|
|
|
- public function getLogoId(): int
|
|
|
+ public function getLogoId(): ?int
|
|
|
{
|
|
|
return $this->logoId;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param int $logoId
|
|
|
+ * @param int|null $logoId
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
|
- public function setLogoId(int $logoId): self
|
|
|
+ public function setLogoId(?int $logoId): self
|
|
|
{
|
|
|
$this->logoId = $logoId;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string|null
|
|
|
+ */
|
|
|
+ public function getDescription(): ?string
|
|
|
+ {
|
|
|
+ return $this->description;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string|null $description
|
|
|
+ * @return FederationStructure
|
|
|
+ */
|
|
|
+ public function setDescription(?string $description): self
|
|
|
+ {
|
|
|
+ $this->description = $description;
|
|
|
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return string
|
|
|
+ * @return int|null
|
|
|
+ */
|
|
|
+ public function getImageId(): ?int
|
|
|
+ {
|
|
|
+ return $this->imageId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param int|null $imageId
|
|
|
+ * @return FederationStructure
|
|
|
+ */
|
|
|
+ public function setImageId(?int $imageId): self
|
|
|
+ {
|
|
|
+ $this->imageId = $imageId;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string|null
|
|
|
*/
|
|
|
- public function getPrincipalType(): string
|
|
|
+ public function getPrincipalType(): ?string
|
|
|
{
|
|
|
return $this->principalType;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param string $principalType
|
|
|
+ * @param string|null $principalType
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
|
- public function setPrincipalType(string $principalType): self
|
|
|
+ public function setPrincipalType(?string $principalType): self
|
|
|
{
|
|
|
$this->principalType = $principalType;
|
|
|
-
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return string
|
|
|
+ * @return string|null
|
|
|
*/
|
|
|
- public function getWebsite(): string
|
|
|
+ public function getWebsite(): ?string
|
|
|
{
|
|
|
return $this->website;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param string $website
|
|
|
+ * @param string|null $website
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
|
- public function setWebsite(string $website): self
|
|
|
+ public function setWebsite(?string $website): self
|
|
|
{
|
|
|
$this->website = $website;
|
|
|
-
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return string
|
|
|
+ * @return string|null
|
|
|
*/
|
|
|
- public function getAddresses(): string
|
|
|
+ public function getAddresses(): ?string
|
|
|
{
|
|
|
return $this->addresses;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param string $addresses
|
|
|
+ * @param string|null $addresses
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
|
- public function setAddresses(string $addresses): self
|
|
|
+ public function setAddresses(?string $addresses): self
|
|
|
{
|
|
|
$this->addresses = $addresses;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string|null
|
|
|
+ */
|
|
|
+ public function getTelphone(): ?string
|
|
|
+ {
|
|
|
+ return $this->telphone;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string|null $telphone
|
|
|
+ */
|
|
|
+ public function setTelphone(?string $telphone): self
|
|
|
+ {
|
|
|
+ $this->telphone = $telphone;
|
|
|
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return string
|
|
|
+ * @return string|null
|
|
|
+ */
|
|
|
+ public function getMobilPhone(): ?string
|
|
|
+ {
|
|
|
+ return $this->mobilPhone;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string|null $mobilPhone
|
|
|
+ */
|
|
|
+ public function setMobilPhone(?string $mobilPhone): self
|
|
|
+ {
|
|
|
+ $this->mobilPhone = $mobilPhone;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string|null
|
|
|
+ */
|
|
|
+ public function getEmail(): ?string
|
|
|
+ {
|
|
|
+ return $this->email;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string|null $email
|
|
|
+ */
|
|
|
+ public function setEmail(?string $email): self
|
|
|
+ {
|
|
|
+ $this->email = $email;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string|null
|
|
|
+ */
|
|
|
+ public function getFacebook(): ?string
|
|
|
+ {
|
|
|
+ return $this->facebook;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string|null $facebook
|
|
|
*/
|
|
|
- public function getPractices(): string
|
|
|
+ public function setFacebook(?string $facebook): self
|
|
|
+ {
|
|
|
+ $this->facebook = $facebook;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string|null
|
|
|
+ */
|
|
|
+ public function getTwitter(): ?string
|
|
|
+ {
|
|
|
+ return $this->twitter;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string|null $twitter
|
|
|
+ */
|
|
|
+ public function setTwitter(?string $twitter): self
|
|
|
+ {
|
|
|
+ $this->twitter = $twitter;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string|null
|
|
|
+ */
|
|
|
+ public function getInstagram(): ?string
|
|
|
+ {
|
|
|
+ return $this->instagram;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string|null $instagram
|
|
|
+ */
|
|
|
+ public function setInstagram(?string $instagram): self
|
|
|
+ {
|
|
|
+ $this->instagram = $instagram;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string|null
|
|
|
+ */
|
|
|
+ public function getYoutube(): ?string
|
|
|
+ {
|
|
|
+ return $this->youtube;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string|null $youtube
|
|
|
+ * @return FederationStructure
|
|
|
+ */
|
|
|
+ public function setYoutube(?string $youtube): self
|
|
|
+ {
|
|
|
+ $this->youtube = $youtube;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return array|null
|
|
|
+ */
|
|
|
+ public function getArticles(): ?array
|
|
|
+ {
|
|
|
+ return $this->articles;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param array|null $articles
|
|
|
+ */
|
|
|
+ public function setArticles(?array $articles): self
|
|
|
+ {
|
|
|
+ $this->articles = $articles;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string|null
|
|
|
+ */
|
|
|
+ public function getPractices(): ?string
|
|
|
{
|
|
|
return $this->practices;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param string $practices
|
|
|
+ * @param string|null $practices
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
|
- public function setPractices(string $practices): self
|
|
|
+ public function setPractices(?string $practices): self
|
|
|
{
|
|
|
$this->practices = $practices;
|
|
|
-
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return int
|
|
|
+ * @return float|null
|
|
|
+ */
|
|
|
+ public function getLatitude(): ?float
|
|
|
+ {
|
|
|
+ return $this->latitude;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param float|null $latitude
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
|
- public function getParentId(): int
|
|
|
+ public function setLatitude(?float $latitude): self
|
|
|
{
|
|
|
- return $this->parentId;
|
|
|
+ $this->latitude = $latitude;
|
|
|
+ return $this;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param int $parentId
|
|
|
+ * @return float|null
|
|
|
*/
|
|
|
- public function setParentId(int $parentId): self
|
|
|
+ public function getLongitude(): ?float
|
|
|
{
|
|
|
- $this->parentId = $parentId;
|
|
|
+ return $this->longitude;
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * @param float|null $longitude
|
|
|
+ * @return FederationStructure
|
|
|
+ */
|
|
|
+ public function setLongitude(?float $longitude): self
|
|
|
+ {
|
|
|
+ $this->longitude = $longitude;
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return int
|
|
|
+ * @return int|null
|
|
|
*/
|
|
|
- public function getN1Id(): int
|
|
|
+ public function getN1Id(): ?int
|
|
|
{
|
|
|
return $this->n1Id;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param int $n1Id
|
|
|
+ * @param int|null $n1Id
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
|
- public function setN1Id(int $n1Id): self
|
|
|
+ public function setN1Id(?int $n1Id): self
|
|
|
{
|
|
|
$this->n1Id = $n1Id;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * @return string|null
|
|
|
+ */
|
|
|
+ public function getN1Name(): ?string
|
|
|
+ {
|
|
|
+ return $this->n1Name;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string|null $n1Name
|
|
|
+ * @return FederationStructure
|
|
|
+ */
|
|
|
+ public function setN1Name(?string $n1Name): self
|
|
|
+ {
|
|
|
+ $this->n1Name = $n1Name;
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return int
|
|
|
+ * @return int|null
|
|
|
*/
|
|
|
- public function getN2Id(): int
|
|
|
+ public function getN2Id(): ?int
|
|
|
{
|
|
|
return $this->n2Id;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param int $n2Id
|
|
|
+ * @param int|null $n2Id
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
|
- public function setN2Id(int $n2Id): self
|
|
|
+ public function setN2Id(?int $n2Id): self
|
|
|
{
|
|
|
$this->n2Id = $n2Id;
|
|
|
-
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return int
|
|
|
+ * @return int|null
|
|
|
*/
|
|
|
- public function getN3Id(): int
|
|
|
+ public function getN3Id(): ?int
|
|
|
{
|
|
|
return $this->n3Id;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param int $n3Id
|
|
|
+ * @param int|null $n3Id
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
|
- public function setN3Id(int $n3Id): self
|
|
|
+ public function setN3Id(?int $n3Id): self
|
|
|
{
|
|
|
$this->n3Id = $n3Id;
|
|
|
-
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return int
|
|
|
+ * @return int|null
|
|
|
*/
|
|
|
- public function getN4Id(): int
|
|
|
+ public function getN4Id(): ?int
|
|
|
{
|
|
|
return $this->n4Id;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param int $n4Id
|
|
|
+ * @param int|null $n4Id
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
|
- public function setN4Id(int $n4Id): self
|
|
|
+ public function setN4Id(?int $n4Id): self
|
|
|
{
|
|
|
$this->n4Id = $n4Id;
|
|
|
-
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return int
|
|
|
+ * @return int|null
|
|
|
*/
|
|
|
- public function getN5Id(): int
|
|
|
+ public function getN5Id(): ?int
|
|
|
{
|
|
|
return $this->n5Id;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param int $n5Id
|
|
|
+ * @param int|null $n5Id
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
|
- public function setN5Id(int $n5Id): self
|
|
|
+ public function setN5Id(?int $n5Id): self
|
|
|
{
|
|
|
$this->n5Id = $n5Id;
|
|
|
-
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return string
|
|
|
+ * @return string|null
|
|
|
*/
|
|
|
- public function getParents(): string
|
|
|
+ public function getParents(): ?string
|
|
|
{
|
|
|
return $this->parents;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param string $parents
|
|
|
+ * @param string|null $parents
|
|
|
+ * @return FederationStructure
|
|
|
*/
|
|
|
- public function setParents(string $parents): self
|
|
|
+ public function setParents(?string $parents): self
|
|
|
{
|
|
|
$this->parents = $parents;
|
|
|
-
|
|
|
return $this;
|
|
|
}
|
|
|
}
|