Skip to content

Commit

Permalink
administration unit: add description and image
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Kurowski committed Oct 31, 2023
1 parent 3b5eecc commit 7cd11ad
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/AdministrationUnit/Response/AdministrationUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use HnutiBrontosaurus\BisClient\AdministrationUnit\Category;
use HnutiBrontosaurus\BisClient\Response\Coordinates;
use HnutiBrontosaurus\BisClient\Response\Image;
use function str_starts_with;


Expand All @@ -16,6 +17,8 @@ final class AdministrationUnit
private function __construct(
private int $id,
private string $name,
private ?string $description,
private ?Image $image,
private bool $isForKids,
private string $address,
private ?Coordinates $coordinates,
Expand All @@ -34,6 +37,8 @@ private function __construct(
* id: int,
* name: string,
* abbreviation: string,
* description: string,
* image: array{small: string, medium: string, large: string, original: string}|null,
* is_for_kids: bool,
* phone: string,
* email: string,
Expand Down Expand Up @@ -64,6 +69,8 @@ public static function fromResponseData(array $data): self
return new self(
$data['id'],
$data['name'],
$data['description'] !== '' ? $data['description'] : null,
$data['image'] !== null ? Image::from($data['image']) : null,
$data['is_for_kids'],
$data['address'],
$data['gps_location'] !== null
Expand Down Expand Up @@ -104,6 +111,21 @@ public function getName(): string
}


public function getDescription(): ?string
{
return $this->description;
}


/**
* @return array{small: string, medium: string, large: string, original: string}|null
*/
public function getImage(): ?array
{
return $this->image;
}


public function getIsForKids(): bool
{
return $this->isForKids;
Expand Down

0 comments on commit 7cd11ad

Please sign in to comment.