public static function EntityHelper::loadRevision in Helper 7
Load a single entity revision.
Parameters
string $entity_type: The entity type of $entity.
int $entity_id: The ID of the entity to load.
int $revision_id: The ID of the revision to load.
Return value
object The entity object of the specific revision, or FALSE on failure.
See also
File
- lib/
EntityHelper.php, line 38
Class
Code
public static function loadRevision($entity_type, $entity_id, $revision_id) {
$conditions = array();
if ($revision_key = static::entityTypeHasProperty($entity_type, array(
'entity keys',
'revision',
))) {
$conditions[$revision_key] = $revision_id;
}
$entities = entity_load($entity_type, array(
$entity_id,
), $conditions);
return reset($entities);
}