public function executeJson($forceMultiple = false)
{
$responses = $this->execute(null, $forceMultiple);
if (!is_array($responses)) {
$responses = array($responses);
$reset = true;
}
$json = array();
foreach ($responses as $key => $response) {
$json[$key] = json_decode($response);
if (null === $json[$key] && 'null' !== strtolower($response)) {
$uri = reset($this->uri);
throw new RepositoryException("Not a valid json object: \nRequest: {$this->method} {$uri} \nResponse: \n{$response}");
}
}
//TODO: are there error responses in json format? if so, handle them
if (isset($reset)) {
return reset($json);
}
return $json;
}