function _services_access_value in Services 6.3
Same name and namespace in other branches
- 7.3 includes/services.runtime.inc \_services_access_value()
4 calls to _services_access_value()
- _comment_resource_access in resources/
comment_resource.inc - Access check callback for comment controllers.
- _file_resource_access in resources/
file_resource.inc - Access check callback for file controllers.
- _node_resource_access in resources/
node_resource.inc - Determine whether the current user can access a node resource.
- _user_resource_access in resources/
user_resource.inc - Access check callback for user resource.
File
- ./
services.runtime.inc, line 450 - Contains functions that only are necessary when a service call is made. This has broken out so that this code isn't loaded for every page load.
Code
function _services_access_value($data, $fields) {
if (!is_array($fields)) {
$fields = array(
$fields,
);
}
foreach ($fields as $field) {
if (is_array($data) && isset($data[$field]) && count($data) == 1) {
return $data[$field];
}
}
return $data;
}