You are here

function microdata_entity_load in Microdata 7

Implements hook_entity_load().

File

./microdata.module, line 272

Code

function microdata_entity_load($entities, $type) {
  foreach ($entities as $entity) {

    // Extracts the bundle of the entity being loaded.
    list($id, $vid, $bundle_type) = entity_extract_ids($type, $entity);
    $microdata_mapping = microdata_get_mapping($type, $bundle_type);

    // Process the mapping into an attributes array that is easier for the
    // field formatter to use.
    $entity->microdata = microdata_mapping_to_attributes($microdata_mapping, $type, $entity);
  }
}