You are here

function entity_revision_load in Drupal 8

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

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the entity type storage's loadRevision() method.

See also

https://www.drupal.org/node/1818376

1 call to entity_revision_load()
EntityLegacyTest::testEntityLegacyCode in core/tests/Drupal/KernelTests/Core/Entity/EntityLegacyTest.php
@expectedDeprecation entity_load_multiple() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the entity type storage's loadMultiple() method. See https://www.drupal.org/node/2266845 @expectedDeprecation entity_load() is…

File

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

Code

function entity_revision_load($entity_type, $revision_id) {
  @trigger_error('entity_revision_load() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the entity type storage\'s loadRevision() method. See https://www.drupal.org/node/1818376', E_USER_DEPRECATED);
  return \Drupal::entityManager()
    ->getStorage($entity_type)
    ->loadRevision($revision_id);
}