mirror of
https://github.com/SkillDisplay/PHPToolKit.git
synced 2024-12-22 10:46:09 +01:00
parent
3ed3abc0d2
commit
16035774e6
1 changed files with 5 additions and 1 deletions
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue