You are here

protected static function clients_connection_drupal_services::fetch in Web Service Clients 7

Gets raw data from service call

1 call to clients_connection_drupal_services::fetch()
clients_connection_drupal_services::call in backends/clients_drupal/clients_drupal.inc
Executes call and processes data

File

backends/clients_drupal/clients_drupal.inc, line 285
Defines methods and calls to Drupal services

Class

clients_connection_drupal_services
General Drupal client class.

Code

protected static function fetch($connection, $resource, $user) {
  $cacheid = md5($connection->name . implode($resource->configuration['options']));

  // user is stdClass if xmlrpc_error()...
  if (!is_array($user) || !isset($user['sessid'])) {

    // @todo watchdog
    drupal_set_message($user->message, 'error');
    return;
  }
  $token = self::getToken($connection, $resource->configuration['options']['method']);

  // catch empty arguments
  $arguments = array_values($resource->configuration['options']['arguments']);
  $arguments = trim($arguments[0]) != '' ? $arguments : array();
  $result = parent::doCall('xmlrpc', $cacheid, $connection->endpoint, $resource->configuration['options']['method'], $token['hash'], $token['domain'], $token['timestamp'], $token['nonce'], $user['sessid'], $resource->configuration['options']['view'], NULL, $arguments, (int) $resource->configuration['options']['offset'], (int) $resource->configuration['options']['limit']);
  return $result;
}