function field_attach_load_revision

Loads all fields for previous versions of a group of entities.

Loading different versions of the same entities is not supported, and should be done by separate calls to the function.

field_attach_load_revision() is automatically called by the default entity controller class, and thus, in most cases, doesn't need to be explicitly called by the entity type module.

Parameters

$entity_type: The type of entities in $entities; e.g. 'node' or 'user'.

$entities: An array of entities for which to load fields, keyed by entity ID. Each entity needs to have its 'bundle', 'id' and (if applicable) 'revision' keys filled. The function adds the loaded field data directly in the entity objects of the $entities array.

$options: An associative array of additional options. See field_attach_load() for details.

Related topics

6 calls to field_attach_load_revision()
DatabaseStorageController::attachLoad in drupal/core/lib/Drupal/Core/Entity/DatabaseStorageController.php
Attaches data to entities upon loading.
DatabaseStorageControllerNG::attachLoad in drupal/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php
Overrides DatabaseStorageController::attachLoad().
FieldAttachStorageTest::testFieldAttachDelete in drupal/core/modules/field/lib/Drupal/field/Tests/FieldAttachStorageTest.php
Test field_attach_delete().
FieldAttachStorageTest::testFieldAttachSaveLoad in drupal/core/modules/field/lib/Drupal/field/Tests/FieldAttachStorageTest.php
Check field values insert, update and load.
FieldSqlStorageTest::testFieldAttachLoad in drupal/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Tests/FieldSqlStorageTest.php
Uses the mysql tables and records to verify field_load_revision works correctly.

... See full list

File

drupal/core/modules/field/field.attach.inc, line 1023
Field attach API, allowing entities (nodes, users, ...) to be 'fieldable'.

Code

function field_attach_load_revision($entity_type, $entities, $options = array()) {
  return field_attach_load($entity_type, $entities, FIELD_LOAD_REVISION, $options);
}