FederationStructure.php 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\ApiResources\Public;
  4. use ApiPlatform\Core\Annotation\ApiProperty;
  5. use ApiPlatform\Core\Annotation\ApiResource;
  6. use App\ApiResources\ApiResourcesInterface;
  7. /**
  8. * Structure telle qu'elle est représentée sur l'iframe de recherche des structures d'une fédération
  9. */
  10. #[ApiResource(
  11. collectionOperations: [
  12. 'get' => [
  13. 'method' => 'GET',
  14. 'path' => '/public/federation_structures' // required query : '?parent={\d+}'
  15. ]
  16. ],
  17. itemOperations: [
  18. 'get' => [
  19. 'method' => 'GET',
  20. 'path' => '/public/federation_structures/{id}',
  21. 'requirements' => ['id' => '\d+']
  22. ]
  23. ]
  24. )]
  25. class FederationStructure implements ApiResourcesInterface
  26. {
  27. #[ApiProperty(identifier: true)]
  28. private int $id;
  29. private ?string $name;
  30. private ?int $logoId;
  31. private ?string $description;
  32. private ?int $imageId;
  33. private ?string $principalType;
  34. private ?string $website;
  35. private string $addresses;
  36. private ?string $telphone;
  37. private ?string $mobilPhone;
  38. private ?string $email;
  39. private ?string $facebook;
  40. private ?string $twitter;
  41. private ?string $instagram;
  42. private ?string $youtube;
  43. private ?array $articles;
  44. private ?string $practices;
  45. private ?float $latitude;
  46. private ?float $longitude;
  47. private ?int $n1Id;
  48. private ?string $n1Name;
  49. private ?int $n2Id;
  50. private ?int $n3Id;
  51. private ?int $n4Id;
  52. private ?int $n5Id;
  53. private ?string $parents;
  54. /**
  55. * @return int
  56. */
  57. public function getId(): int
  58. {
  59. return $this->id;
  60. }
  61. /**
  62. * @param int $id
  63. * @return FederationStructure
  64. */
  65. public function setId(int $id): self
  66. {
  67. $this->id = $id;
  68. return $this;
  69. }
  70. /**
  71. * @return string
  72. */
  73. public function getName(): string
  74. {
  75. return $this->name;
  76. }
  77. /**
  78. * @param string $name
  79. * @return FederationStructure
  80. */
  81. public function setName(string $name): self
  82. {
  83. $this->name = $name;
  84. return $this;
  85. }
  86. /**
  87. * @return int|null
  88. */
  89. public function getLogoId(): ?int
  90. {
  91. return $this->logoId;
  92. }
  93. /**
  94. * @param int|null $logoId
  95. * @return FederationStructure
  96. */
  97. public function setLogoId(?int $logoId): self
  98. {
  99. $this->logoId = $logoId;
  100. return $this;
  101. }
  102. /**
  103. * @return string|null
  104. */
  105. public function getDescription(): ?string
  106. {
  107. return $this->description;
  108. }
  109. /**
  110. * @param string|null $description
  111. * @return FederationStructure
  112. */
  113. public function setDescription(?string $description): self
  114. {
  115. $this->description = $description;
  116. return $this;
  117. }
  118. /**
  119. * @return int|null
  120. */
  121. public function getImageId(): ?int
  122. {
  123. return $this->imageId;
  124. }
  125. /**
  126. * @param int|null $imageId
  127. * @return FederationStructure
  128. */
  129. public function setImageId(?int $imageId): self
  130. {
  131. $this->imageId = $imageId;
  132. return $this;
  133. }
  134. /**
  135. * @return string|null
  136. */
  137. public function getPrincipalType(): ?string
  138. {
  139. return $this->principalType;
  140. }
  141. /**
  142. * @param string|null $principalType
  143. * @return FederationStructure
  144. */
  145. public function setPrincipalType(?string $principalType): self
  146. {
  147. $this->principalType = $principalType;
  148. return $this;
  149. }
  150. /**
  151. * @return string|null
  152. */
  153. public function getWebsite(): ?string
  154. {
  155. return $this->website;
  156. }
  157. /**
  158. * @param string|null $website
  159. * @return FederationStructure
  160. */
  161. public function setWebsite(?string $website): self
  162. {
  163. $this->website = $website;
  164. return $this;
  165. }
  166. /**
  167. * @return string|null
  168. */
  169. public function getAddresses(): ?string
  170. {
  171. return $this->addresses;
  172. }
  173. /**
  174. * @param string|null $addresses
  175. * @return FederationStructure
  176. */
  177. public function setAddresses(?string $addresses): self
  178. {
  179. $this->addresses = $addresses;
  180. return $this;
  181. }
  182. /**
  183. * @return string|null
  184. */
  185. public function getTelphone(): ?string
  186. {
  187. return $this->telphone;
  188. }
  189. /**
  190. * @param string|null $telphone
  191. */
  192. public function setTelphone(?string $telphone): self
  193. {
  194. $this->telphone = $telphone;
  195. return $this;
  196. }
  197. /**
  198. * @return string|null
  199. */
  200. public function getMobilPhone(): ?string
  201. {
  202. return $this->mobilPhone;
  203. }
  204. /**
  205. * @param string|null $mobilPhone
  206. */
  207. public function setMobilPhone(?string $mobilPhone): self
  208. {
  209. $this->mobilPhone = $mobilPhone;
  210. return $this;
  211. }
  212. /**
  213. * @return string|null
  214. */
  215. public function getEmail(): ?string
  216. {
  217. return $this->email;
  218. }
  219. /**
  220. * @param string|null $email
  221. */
  222. public function setEmail(?string $email): self
  223. {
  224. $this->email = $email;
  225. return $this;
  226. }
  227. /**
  228. * @return string|null
  229. */
  230. public function getFacebook(): ?string
  231. {
  232. return $this->facebook;
  233. }
  234. /**
  235. * @param string|null $facebook
  236. */
  237. public function setFacebook(?string $facebook): self
  238. {
  239. $this->facebook = $facebook;
  240. return $this;
  241. }
  242. /**
  243. * @return string|null
  244. */
  245. public function getTwitter(): ?string
  246. {
  247. return $this->twitter;
  248. }
  249. /**
  250. * @param string|null $twitter
  251. */
  252. public function setTwitter(?string $twitter): self
  253. {
  254. $this->twitter = $twitter;
  255. return $this;
  256. }
  257. /**
  258. * @return string|null
  259. */
  260. public function getInstagram(): ?string
  261. {
  262. return $this->instagram;
  263. }
  264. /**
  265. * @param string|null $instagram
  266. */
  267. public function setInstagram(?string $instagram): self
  268. {
  269. $this->instagram = $instagram;
  270. return $this;
  271. }
  272. /**
  273. * @return string|null
  274. */
  275. public function getYoutube(): ?string
  276. {
  277. return $this->youtube;
  278. }
  279. /**
  280. * @param string|null $youtube
  281. * @return FederationStructure
  282. */
  283. public function setYoutube(?string $youtube): self
  284. {
  285. $this->youtube = $youtube;
  286. return $this;
  287. }
  288. /**
  289. * @return array|null
  290. */
  291. public function getArticles(): ?array
  292. {
  293. return $this->articles;
  294. }
  295. /**
  296. * @param array|null $articles
  297. */
  298. public function setArticles(?array $articles): self
  299. {
  300. $this->articles = $articles;
  301. return $this;
  302. }
  303. /**
  304. * @return string|null
  305. */
  306. public function getPractices(): ?string
  307. {
  308. return $this->practices;
  309. }
  310. /**
  311. * @param string|null $practices
  312. * @return FederationStructure
  313. */
  314. public function setPractices(?string $practices): self
  315. {
  316. $this->practices = $practices;
  317. return $this;
  318. }
  319. /**
  320. * @return float|null
  321. */
  322. public function getLatitude(): ?float
  323. {
  324. return $this->latitude;
  325. }
  326. /**
  327. * @param float|null $latitude
  328. * @return FederationStructure
  329. */
  330. public function setLatitude(?float $latitude): self
  331. {
  332. $this->latitude = $latitude;
  333. return $this;
  334. }
  335. /**
  336. * @return float|null
  337. */
  338. public function getLongitude(): ?float
  339. {
  340. return $this->longitude;
  341. }
  342. /**
  343. * @param float|null $longitude
  344. * @return FederationStructure
  345. */
  346. public function setLongitude(?float $longitude): self
  347. {
  348. $this->longitude = $longitude;
  349. return $this;
  350. }
  351. /**
  352. * @return int|null
  353. */
  354. public function getN1Id(): ?int
  355. {
  356. return $this->n1Id;
  357. }
  358. /**
  359. * @param int|null $n1Id
  360. * @return FederationStructure
  361. */
  362. public function setN1Id(?int $n1Id): self
  363. {
  364. $this->n1Id = $n1Id;
  365. return $this;
  366. }
  367. /**
  368. * @return string|null
  369. */
  370. public function getN1Name(): ?string
  371. {
  372. return $this->n1Name;
  373. }
  374. /**
  375. * @param string|null $n1Name
  376. * @return FederationStructure
  377. */
  378. public function setN1Name(?string $n1Name): self
  379. {
  380. $this->n1Name = $n1Name;
  381. return $this;
  382. }
  383. /**
  384. * @return int|null
  385. */
  386. public function getN2Id(): ?int
  387. {
  388. return $this->n2Id;
  389. }
  390. /**
  391. * @param int|null $n2Id
  392. * @return FederationStructure
  393. */
  394. public function setN2Id(?int $n2Id): self
  395. {
  396. $this->n2Id = $n2Id;
  397. return $this;
  398. }
  399. /**
  400. * @return int|null
  401. */
  402. public function getN3Id(): ?int
  403. {
  404. return $this->n3Id;
  405. }
  406. /**
  407. * @param int|null $n3Id
  408. * @return FederationStructure
  409. */
  410. public function setN3Id(?int $n3Id): self
  411. {
  412. $this->n3Id = $n3Id;
  413. return $this;
  414. }
  415. /**
  416. * @return int|null
  417. */
  418. public function getN4Id(): ?int
  419. {
  420. return $this->n4Id;
  421. }
  422. /**
  423. * @param int|null $n4Id
  424. * @return FederationStructure
  425. */
  426. public function setN4Id(?int $n4Id): self
  427. {
  428. $this->n4Id = $n4Id;
  429. return $this;
  430. }
  431. /**
  432. * @return int|null
  433. */
  434. public function getN5Id(): ?int
  435. {
  436. return $this->n5Id;
  437. }
  438. /**
  439. * @param int|null $n5Id
  440. * @return FederationStructure
  441. */
  442. public function setN5Id(?int $n5Id): self
  443. {
  444. $this->n5Id = $n5Id;
  445. return $this;
  446. }
  447. /**
  448. * @return string|null
  449. */
  450. public function getParents(): ?string
  451. {
  452. return $this->parents;
  453. }
  454. /**
  455. * @param string|null $parents
  456. * @return FederationStructure
  457. */
  458. public function setParents(?string $parents): self
  459. {
  460. $this->parents = $parents;
  461. return $this;
  462. }
  463. }