You are here

function services_controller_get in Services 6.3

Same name and namespace in other branches
  1. 7.3 services.module \services_controller_get()

Returns the requested controller.

Parameters

string $name: The name of the controller in the format: {resource}.{name} or {resource}.{operation}. Examples: "node.retrieve", "system.getVariable".

string $endpoint: The endpoint that should be used.

1 call to services_controller_get()
xmlrpc_server_call_wrapper in servers/xmlrpc_server/xmlrpc_server.module
Pass XMLRPC server requests to the appropriate services method.

File

./services.module, line 433
Provides a generic but powerful API for web services.

Code

function services_controller_get($name, $endpoint) {
  list($resource_name, $method) = explode('.', $name);
  $resources = services_get_resources($endpoint);
  if (isset($resources[$resource_name])) {
    $res = $resources[$resource_name];
    if (isset($res[$method])) {
      return $res[$method];
    }
    else {
      $class_info = services_operation_class_info();

      // Handle extended operatios
      foreach ($class_info as $class => $info) {
        if (isset($res[$class]) && isset($res[$class][$method])) {
          return $res[$class][$method];
        }
      }
    }
  }
}