function _services_entity_transform_fields in Services Entity API 7
Recursive function to get all fields and the children of those fields noted by field_name:child_name.
3 calls to _services_entity_transform_fields()
File
- ./
services_entity.resources.inc, line 139
Code
function _services_entity_transform_fields(array $fields) {
$transformed_fields = array();
foreach ($fields as $field) {
if (!strpos($field, ':') == 0) {
list($parent, $child) = explode(':', $field, 2);
$value = _services_entity_transform_fields(array(
$child,
));
$transformed_fields[$parent] = isset($transformed_fields[$parent]) ? array_merge_recursive($transformed_fields[$parent], $value) : $value;
}
else {
$transformed_fields[$field] = $field;
}
}
return $transformed_fields;
}