You are here

function entity_revision_load in Entity API 7

Loads an entity revision.

Parameters

$entity_type: The type of the entity.

$revision_id: The id of the revision to load.

Return value

object|false The entity object, or FALSE if there is no entity with the given revision id.

2 calls to entity_revision_load()
EntityAPIController::deleteRevision in includes/entity.controller.inc
Implements EntityAPIControllerRevisionableInterface::deleteRevision().
EntityAPITestCase::testCRUDRevisisions in ./entity.test
Tests CRUD for entities supporting revisions.

File

./entity.module, line 362

Code

function entity_revision_load($entity_type, $revision_id) {
  $info = entity_get_info($entity_type);
  if (!empty($info['entity keys']['revision'])) {
    $entity_revisions = entity_load($entity_type, FALSE, array(
      $info['entity keys']['revision'] => $revision_id,
    ));
    return reset($entity_revisions);
  }
  return FALSE;
}