CoreApi: allow to fetch a single object
This commit is contained in:
parent
3c5118ca0a
commit
dddf0d8ac5
|
@ -40,6 +40,17 @@ class CoreApi
|
|||
)->getResult('name');
|
||||
}
|
||||
|
||||
public function getObject($name, $pluraltype, $attrs = array())
|
||||
{
|
||||
$params = (object) array(
|
||||
);
|
||||
if (! empty($attrs)) {
|
||||
$params->attrs = $attrs;
|
||||
}
|
||||
$url = 'objects/' . urlencode(strtolower($pluraltype)) . '/' . rawurlencode($name) . '?all_joins=1';
|
||||
return $this->client->get($url, $params)->getResult('name');
|
||||
}
|
||||
|
||||
public function getTypes()
|
||||
{
|
||||
return $this->client->get('types')->getResult('name');
|
||||
|
|
Loading…
Reference in New Issue