You are here

function wsclient_map_type in Web service client 7

Maps the type name from the name used by the remote info to the rules name.

4 calls to wsclient_map_type()
wsclient_rules_action_info in ./wsclient.rules.inc
Implements hook_rules_action_info().
wsclient_ui_operation in wsclient_ui/wsclient_ui.inc
Operation form.
_wsclient_ui_parameter_row in wsclient_ui/wsclient_ui.inc
Generates a row in the parameter table.
_wsclient_ui_property_row in wsclient_ui/wsclient_ui.inc
Generates a row in the properties table.

File

./wsclient.module, line 121
Web service client - module file.

Code

function wsclient_map_type($service_name, $service_types, $type) {
  if (is_array($type)) {
    foreach ($type as $key => $entry) {
      $type[$key] = wsclient_map_type($service_name, $service_types, $entry);
    }
    return $type;
  }
  if (isset($service_types[$type])) {
    return 'wsclient_' . $service_name . '_' . $type;
  }
  if (strpos($type, 'list<') === 0 && isset($service_types[substr($type, 5, -1)])) {
    return 'list<wsclient_' . $service_name . '_' . substr($type, 5, -1) . '>';
  }
  return $type;
}