You are here

function _services_resource_controller_as_service in Services 6.2

Same name and namespace in other branches
  1. 7 services.resource-translation.inc \_services_resource_controller_as_service()

Helper function for _services_resource_as_services() that turns a resource controller into a service method.

2 calls to _services_resource_controller_as_service()
services_method_call in ./services.module
Invokes a services method.
_services_resource_as_services in ./services.resource-translation.inc
Returns the given resource as a set of services methods.

File

./services.resource-translation.inc, line 60
Contains the necessary functionality for translating resources to services methods and vice versa.

Code

function _services_resource_controller_as_service($resource, $name, $controller, $file) {
  $method = array_merge($controller, array(
    'method' => $resource . '_resource.' . $name,
  ));
  if (!empty($file) && !empty($method['file'])) {
    $method['file'] = $file;
  }
  return $method;
}