Skip to content

Commit

Permalink
Add method to get entity details
Browse files Browse the repository at this point in the history
  • Loading branch information
anagh-p committed May 3, 2017
1 parent b24b14a commit 87050b4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Quintype/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function __construct($apiHost, $globalSettings = [])
$this->breakingNews = new BreakingNews($this->client, $globalSettings);
$this->contactUs = new ContactUs($this->client, $globalSettings);
$this->collections = new Collections($this->client, $globalSettings);
$this->entities = new Entities($this->client);
}

public function config()
Expand Down Expand Up @@ -172,4 +173,9 @@ public function getCollections($collection, $params) {
public function bulkCollections($requestPayload) {
return $this->collections->bulkCollections($requestPayload);
}

//Version 1.10.0 onwards
public function getEntity($entityId = '') {
return $this->entities->getEntity($entityId);
}
}
20 changes: 20 additions & 0 deletions src/Quintype/Api/Entities.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Quintype\Api;

class Entities
{
public function __construct($client)
{
$this->base = new BaseFunctions($client);
}

public function getEntity($entityId)
{
$query = '/api/v1/entity/'.$entityId;
$response = $this->base->getResponse($query);


return $response;
}
}

0 comments on commit 87050b4

Please sign in to comment.