You are here

function clients_drupal_clients_setparams in Web Service Clients 6

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

Implementation of hook_clients_setparams

File

backends/clients_drupal/clients_drupal.module, line 354
Drupal Services plugin for Clients module @author Django Beatty - adub

Code

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

  // need to make static?
  if ($connection->type == variable_get('clients_drupal_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);
      }
    }
  }
}