You are here

function services_entity_prepare_structure in Services Entity API 7

Prepare data structrure recursively and using metadata wrapper to retrieve the hierarchical properties.

4 calls to services_entity_prepare_structure()
ServicesEntityBasic::assertFieldPropertyFetching in tests/services_entity.test
ServicesEntityBasic::testPropertyFetching in tests/services_entity.test
_services_entity_prepare_structure in ./services_entity.module
_services_postprocess_entities in ./services_entity.resources.inc

File

./services_entity.module, line 7

Code

function services_entity_prepare_structure(EntityStructureWrapper $wrapper, array $properties = array()) {
  if (empty($properties)) {

    // By default, expand all the non-computed properties.
    $properties = array();
    foreach ($wrapper
      ->getPropertyInfo() as $property_name => $property_info) {
      if (empty($property_info['computed'])) {
        $properties[$property_name] = $property_name;
      }
    }
  }
  return _services_entity_prepare_structure($wrapper, $properties);
}