function _services_services_as_resources in Services 7
Same name and namespace in other branches
- 6.2 services.resource-translation.inc \_services_services_as_resources()
1 call to _services_services_as_resources()
- services_get_all_resources in ./
services.module - Gets all resource definitions.
File
- ./
services.resource-translation.inc, line 57 - @author Services Dev Team
Code
function _services_services_as_resources($services) {
$resources = array();
foreach ($services as $service) {
$signature = preg_split('/\\./', $service['#method']);
$controller = $service;
$controller['#args'] = array();
foreach ($service['#args'] as $arg) {
$arg['#source'] = array(
'data' => $arg['#name'],
);
$controller['#args'][] = $arg;
}
$resources['service_' . $signature[0]]['#actions'][$signature[1]] = $controller;
}
return $resources;
}