Skip to content

Instantly share code, notes, and snippets.

@cotto
Created September 27, 2011 17:53
Show Gist options
  • Save cotto/1245746 to your computer and use it in GitHub Desktop.
Save cotto/1245746 to your computer and use it in GitHub Desktop.
/**
* Extract arguments for a services method access callback, preserving backwards compatibility with #1083242.
*/
function _services_access_value($data, $fields) {
if (!is_array($fields)) {
$fields = array($fields);
}
foreach ($field as $field) {
if (is_array($data) && isset($data[$field]) {
return $data[$field];
}
}
return $data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment