function entity_revision_load

Loads an entity from the database.

Parameters

string $entity_type: The entity type to load, e.g. node or user.

int $revision_id: The id of the entity to load.

Return value

Drupal\Core\Entity\EntityInterface The entity object, or FALSE if there is no entity with the given revision id.

See also

\Drupal\Core\Entity\EntityManager

Drupal\Core\Entity\EntityStorageControllerInterface

Drupal\Core\Entity\DatabaseStorageController

5 calls to entity_revision_load()
CustomBlockRevisionsTest::testRevisions in drupal/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockRevisionsTest.php
Checks block revision related operations.
EntityReferenceFormatterBase::prepareView in drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceFormatterBase.php
Overrides \Drupal\field\Plugin\Type\Formatter\FormatterBase::prepareView().
EntityRevisionsTest::assertRevisions in drupal/core/modules/system/lib/Drupal/system/Tests/Entity/EntityRevisionsTest.php
Executes the revision tests for the given entity type.
node_revision_load in drupal/core/modules/node/node.module
Loads a node revision from the database.
Sql::loadEntities in drupal/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php
Loads all entities contained in the passed-in $results. . If the entity belongs to the base table, then it gets stored in $result->_entity. Otherwise, it gets stored in $result->_relationship_entities[$relationship_id];

File

drupal/core/includes/entity.inc, line 185
Entity API for handling entities like nodes or users.

Code

function entity_revision_load($entity_type, $revision_id) {
  return Drupal::entityManager()
    ->getStorageController($entity_type)
    ->loadRevision($revision_id);
}