From 1a30977be4b62505cef3669c369af0436b68c03d Mon Sep 17 00:00:00 2001 From: Daniel Kurowski Date: Mon, 5 Jun 2023 18:59:03 +0200 Subject: [PATCH] support gps coords for administration units --- .../Response/AdministrationUnit.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/AdministrationUnit/Response/AdministrationUnit.php b/src/AdministrationUnit/Response/AdministrationUnit.php index 3702425..3c57595 100644 --- a/src/AdministrationUnit/Response/AdministrationUnit.php +++ b/src/AdministrationUnit/Response/AdministrationUnit.php @@ -43,6 +43,10 @@ private function __construct( * bank_account_number: string, * existed_since: string|null, * existed_till: string|null, + * gps_location: array{ + * type: string, + * coordinates: array{0: float, 1: float}, + * }|null, * category: array{ * id: int, * name: string, @@ -61,10 +65,12 @@ public static function fromResponseData(array $data): self $data['name'], $data['is_for_kids'], $data['address'], - null, // temporary not available - /* $data['gps_latitude'] !== null && $data['gps_longitude'] !== null - ? Coordinates::from($data['gps_latitude'], $data['gps_longitude']) - : null,*/ + $data['gps_location'] !== null + ? Coordinates::from( + $data['gps_location']['coordinates'][1], + $data['gps_location']['coordinates'][0], + ) + : null, $data['phone'] !== '' ? $data['phone'] : null, $data['email'] !== '' ? $data['email'] : null, $data['www'] !== '' ? $data['www'] : null,