From 314d9b1a56a79a79d31e016762f27924c4c5e681 Mon Sep 17 00:00:00 2001 From: clementtalleu Date: Wed, 15 May 2019 14:30:11 +0200 Subject: [PATCH 1/2] add get user tags --- Linkdata/Client/LinkdataClient.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Linkdata/Client/LinkdataClient.php b/Linkdata/Client/LinkdataClient.php index 229f51d..5fdc2a2 100644 --- a/Linkdata/Client/LinkdataClient.php +++ b/Linkdata/Client/LinkdataClient.php @@ -245,4 +245,19 @@ private function getUrlFilters(?array $filters) } return $urlFilters; } + + /** + * @throws ClientHydraException + */ + public function getUserTags(string $userId): ProxyCollection + { + try { + return $this->getAdapter()->makeRequest( + 'GET', + \sprintf('/v2/users/%s/tags', $userId) + )->getContent(); + } catch (ClientHydraException $e) { + return []; + } + } } From e924f69142a66ac851a290c6d2a411fdbbce05c4 Mon Sep 17 00:00:00 2001 From: clementtalleu Date: Wed, 15 May 2019 15:54:21 +0200 Subject: [PATCH 2/2] array instead ProxyCollection --- Linkdata/Client/LinkdataClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Linkdata/Client/LinkdataClient.php b/Linkdata/Client/LinkdataClient.php index 5fdc2a2..58e1523 100644 --- a/Linkdata/Client/LinkdataClient.php +++ b/Linkdata/Client/LinkdataClient.php @@ -249,7 +249,7 @@ private function getUrlFilters(?array $filters) /** * @throws ClientHydraException */ - public function getUserTags(string $userId): ProxyCollection + public function getUserTags(string $userId): array { try { return $this->getAdapter()->makeRequest(