You are here

public function WSClientServiceDescription::actions in Web service client 7

Returns info about the actions of the web service.

File

./wsclient.inc, line 134
Web service client - include file.

Class

WSClientServiceDescription
Class representing web service descriptions.

Code

public function actions() {
  $actions = array();
  foreach ($this->operations as $name => $operation) {
    $actions[$name] = $operation += array(
      'base' => 'wsclient_service_action',
      'named parameter' => TRUE,
    );
    $actions[$name]['parameter'] = array();
    if (isset($operation['parameter'])) {

      // Prefix operation parameter names to avoid name clashes.
      foreach ((array) $operation['parameter'] as $param => $info) {
        $actions[$name]['parameter']['param_' . $param] = $info;
      }
    }
    $actions[$name]['parameter']['service'] = array(
      'type' => 'hidden',
      'default value' => $this->name,
    );
    $actions[$name]['parameter']['operation'] = array(
      'type' => 'hidden',
      'default value' => $name,
    );

    // Pass through the service result as provided variable.
    if (!empty($actions[$name]['result'])) {
      $actions[$name]['provides']['result'] = $actions[$name]['result'];
      unset($actions[$name]['result']);
    }
  }
  return $actions;
}