You are here

function clients_fields in Web Service Clients 6

Same name and namespace in other branches
  1. 7 clients.module \clients_fields()

defines hook_clients_fields

2 calls to clients_fields()
clients_views_views_data in clients/clients_views/clients_views.module
FeedsClientsParser::getMappingSources in clients/clients_feeds/FeedsClientsParser.inc
Return mapping sources.

File

./clients.module, line 280
Clients module - handles keys and service connections and provides an API for clients @author Django Beatty - adub

Code

function clients_fields($resource = NULL) {
  $fields = module_invoke_all('clients_fields', $resource);

  // module_invoke_all performs an array_merge_recursive. This flattens out multiple fields with same name to use the first value
  $result = array();
  foreach ($fields as $field => $val) {
    if (is_array($val['name'])) {
      $val['name'] = $val['name'][0];
      $val['description'] = $val['description'][0];
    }
    $result[$field] = $val;
  }
  return $result;
}