CoreApi: return only single element for getObject

This commit is contained in:
Thomas Gelf 2015-12-17 10:33:11 +01:00
parent 23cfbb12a4
commit a9f2bd8f97

View File

@ -54,7 +54,10 @@ class CoreApi
$params->attrs = $attrs; $params->attrs = $attrs;
} }
$url = 'objects/' . urlencode(strtolower($pluraltype)) . '/' . rawurlencode($name) . '?all_joins=1'; $url = 'objects/' . urlencode(strtolower($pluraltype)) . '/' . rawurlencode($name) . '?all_joins=1';
return $this->client->get($url, $params)->getResult('name'); $res = $this->client->get($url, $params)->getResult('name');
// TODO: check key, throw
return $res[$name];
} }
public function getConstants() public function getConstants()