diff --git a/src/Event/Response/Event.php b/src/Event/Response/Event.php index 98ad832..7d70107 100644 --- a/src/Event/Response/Event.php +++ b/src/Event/Response/Event.php @@ -19,6 +19,7 @@ final class Event { /** + * @param Tag[] $tags * @param string[] $administrationUnits * @param Photo[] $photos * @param array $rawData @@ -34,6 +35,7 @@ private function __construct( private Location $location, private Group $group, private Category $category, + private array $tags, private Program $program, private IntendedFor $intendedFor, private array $administrationUnits, @@ -80,6 +82,13 @@ private function __construct( * name: string, * slug: string, * }, + * tags: array, * program: array{ * id: int, * name: string, @@ -141,6 +150,7 @@ public static function fromResponseData(array $data): self ), Group::fromScalar($data['group']['slug']), Category::fromScalar($data['category']['slug']), + array_map(static fn(array $tag) => Tag::fromPayload($tag), $data['tags']), Program::fromScalar($data['program']['slug']), IntendedFor::fromScalar($data['intended_for']['slug']), $data['administration_units'], @@ -242,6 +252,15 @@ public function getCategory(): Category } + /** + * @return Tag[] + */ + public function getTags(): array + { + return $this->tags; + } + + public function getProgram(): Program { return $this->program; diff --git a/src/Event/Response/Tag.php b/src/Event/Response/Tag.php new file mode 100644 index 0000000..9c0eacd --- /dev/null +++ b/src/Event/Response/Tag.php @@ -0,0 +1,68 @@ +id; + } + + + public function getName(): string + { + return $this->name; + } + + + public function getSlug(): string + { + return $this->slug; + } + + + public function getDescription(): string + { + return $this->description; + } + + + public function isActive(): bool + { + return $this->isActive; + } + +}