CoreApi: allow to fetch a single object

This commit is contained in:
Thomas Gelf 2015-11-26 18:53:42 +01:00
parent 3c5118ca0a
commit dddf0d8ac5
1 changed files with 11 additions and 0 deletions

View File

@ -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');