Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/API/Resources/ResourceEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class ResourceEntity extends DataTransferObject
public ?string $officeExtension;
public ?string $officePhone;
public int $payrollType;
public ?string $payrollIdentifier;
public string $resourceType;
public ?int $suffix;
public ?float $surveyResourceRating;
Expand Down
5 changes: 5 additions & 0 deletions src/API/TicketAttachments/TicketAttachmentEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ public static function fromResponse(Response $response)
{
$responseArray = json_decode($response->getBody(), true);

//findByID method returns $responseArray["items"], but there should always only be 1 item returned from the API by ID.
if(isset($responseArray["items"]) && is_array($responseArray["items"]) && count($responseArray["items"]) == 1){
return new self($responseArray["items"][0]);
}

if (isset($responseArray['item']) === false) {
throw new \Exception('Missing item key in response.');
}
Expand Down