From 16035774e630ad5bda0d8edde2b20a25a47b0bfa Mon Sep 17 00:00:00 2001 From: Markus Klein Date: Fri, 2 Jul 2021 15:55:58 +0200 Subject: [PATCH] [FEATURE] Support includeFullSkills for SkillSets Fixes: #10 --- src/Api/SkillSet.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Api/SkillSet.php b/src/Api/SkillSet.php index 0425bf5..fb55c7a 100644 --- a/src/Api/SkillSet.php +++ b/src/Api/SkillSet.php @@ -24,6 +24,7 @@ namespace SkillDisplay\PHPToolKit\Api; */ use GuzzleHttp\Client; +use GuzzleHttp\Exception\ClientException; use GuzzleHttp\Psr7\Request; use SkillDisplay\PHPToolKit\Configuration\Settings; use SkillDisplay\PHPToolKit\Entity\SkillSet as Entity; @@ -48,13 +49,16 @@ class SkillSet $this->client = $client; } - public function getById(int $id): Entity + public function getById(int $id, bool $includeFullSkills = false): Entity { if ($id <= 0) { throw new \Exception('ID of SkillSet has to be a positive integer.', 1600764811); } $url = $this->settings->getAPIUrl() . '/api/v1/skillset/' . $id; + if ($includeFullSkills) { + $url .= '?includeFullSkills'; + } try { $result = $this->client->send(new Request( 'GET',