You are here

function wsfields_storage_field_storage_load in Web Service Data 7

Implements hook_field_storage_load().

File

modules/wsfields_storage/wsfields_storage.module, line 172
Storage controller definitions

Code

function wsfields_storage_field_storage_load($entity_type, $entities, $age, $fields, $options) {

  // Load the list of fields
  $field_info = field_info_field_by_ids();
  $load_current = $age == FIELD_LOAD_CURRENT;

  // Loop through the fields
  foreach ($fields as $field_id => $ids) {
    $field = $field_info[$field_id];
    $field_name = $field['field_name'];

    // Load the data for each entity
    foreach ($entities as $entityid => $entity) {

      // Load the field data into the entity
      $entities[$entityid]->{$field_name} = wsfields_data_load($entity_type, $field, $entity);
    }
  }
}