19 public function query(array $params = array())
21 if ($this->useDirectQuery)
23 return $this->directQuery($params);
26 $methodName = static::REST_METHOD_PREFIX .
'.' . $params[
'methodName'];
27 $parameters = $params[
'parameters'];
29 if (!$engine->isRegistered())
33 $parameters[
'proxy_client_id'] = $this->getAuthAdapter()->getClientId();
34 $parameters[
'lang'] = LANGUAGE_ID;
36 $transport = $engine->getInterface()->getTransport();
37 if ($params[
'timeout'])
39 $transport->setTimeout($params[
'timeout']);
41 $response = $transport->call($methodName, $parameters);
42 if ($response[
'result'][
'RESULT'])
44 return $response[
'result'][
'RESULT'];
46 if ($response[
'error'])
48 throw new InvalidOperationException($response[
'error_description'] ? $response[
'error_description'] : $response[
'error']);