You are here

function clients_drupal_clients_setparams in Web Service Clients 7

Same name and namespace in other branches
  1. 6 backends/clients_drupal/clients_drupal.module \clients_drupal_clients_setparams()

Implementation of hook_clients_setparams

File

backends/clients_drupal/clients_drupal.module, line 163
Drupal Services plugin for Clients module

Code

function clients_drupal_clients_setparams(&$resource, $arg) {
  $connection = clients_connection_load((int) $resource->cid);

  // need to make static?
  if ($connection->type == 'drupal_services') {
    foreach ($arg as $key => $value) {

      // doesn't support multiple args...
      if ($key == 'argument') {
        $resource->configuration['options']['arguments']['first'] = str_replace(' ', '+', $value);
      }
      else {
        $resource->configuration['options'][$key] = str_replace(' ', '+', $value);
      }
    }
  }
}