forked from mpclarkson/freshdesk-php-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Freshdesk\Resources\Traits; | ||
|
||
/** | ||
* View Trait | ||
* | ||
* @package Freshdesk\Resources\Traits | ||
* | ||
*/ | ||
trait CategoryTrait | ||
{ | ||
|
||
/** | ||
* @return \Freshdesk\Api | ||
* @internal | ||
*/ | ||
abstract protected function api(); | ||
|
||
/** | ||
* View a resource | ||
* | ||
* Use 'include' to embed additional details in the response. Each include will consume an additional credit. | ||
* For example if you embed the requester and company information you will be charged a total of 3 API credits for the call. | ||
* See Freshdesk's documentation for details. | ||
* | ||
* @api | ||
* @param int $id The resource id | ||
* @param array|null $query | ||
* @return array|null | ||
* @throws \Freshdesk\Exceptions\AccessDeniedException | ||
* @throws \Freshdesk\Exceptions\ApiException | ||
* @throws \Freshdesk\Exceptions\AuthenticationException | ||
* @throws \Freshdesk\Exceptions\ConflictingStateException | ||
* @throws \Freshdesk\Exceptions\NotFoundException | ||
* @throws \Freshdesk\Exceptions\RateLimitExceededException | ||
* @throws \Freshdesk\Exceptions\UnsupportedContentTypeException | ||
* @throws \Freshdesk\Exceptions\MethodNotAllowedException | ||
* @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException | ||
* @throws \Freshdesk\Exceptions\ValidationException | ||
*/ | ||
public function forCategory($id, array $query = null) | ||
{ | ||
return $this->api()->request('GET', $this->categoryEndpoint($id) . $this->endpoint, null, $query); | ||
} | ||
} |