Skip to content

Commit

Permalink
support gps coords for administration units
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Kurowski committed Jun 5, 2023
1 parent c03326d commit 1a30977
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/AdministrationUnit/Response/AdministrationUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 1a30977

Please sign in to comment.