You are here

function entity_revision_load in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/includes/entity.inc \entity_revision_load()

Loads an entity from the database.

\Drupal::entityManager()
  ->getStorage($entity_type)
  ->loadRevision($revision_id);

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|null The entity object, or NULL if there is no entity with the given revision id.

Deprecated

as of Drupal 8.0.x, will be removed before Drupal 9.0.0. Use the entity storage's loadRevision() method to load a specific entity revision:

See also

\Drupal\Core\Entity\EntityManagerInterface::getStorage()

\Drupal\Core\Entity\EntityStorageInterface::loadRevision()

\Drupal\Core\Entity\Sql\SqlContentEntityStorage

7 calls to entity_revision_load()
BlockContentRevisionsTest::testRevisions in core/modules/block_content/src/Tests/BlockContentRevisionsTest.php
Checks block revision related operations.
EntityRevisionsTest::runRevisionsTests in core/modules/system/src/Tests/Entity/EntityRevisionsTest.php
Executes the revision tests for the given entity type.
node_mass_update in core/modules/node/node.admin.inc
Updates all nodes in the passed-in array with the passed-in field values.
node_revision_load in core/modules/node/node.module
Loads a node revision from the database.
Sql::loadEntities in core/modules/views/src/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];

... See full list

File

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

Code

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