Same name and namespace in other branches
  1. 4.6.x modules/node.module \node_revision_load()
  2. 8.9.x core/modules/node/node.module \node_revision_load()
  3. 9 core/modules/node/node.module \node_revision_load()

Loads a node revision from the database.

Parameters

int $vid: The node revision id.

Return value

\Drupal\node\NodeInterface|null A fully-populated node entity, or NULL if the node is not found.

Deprecated

in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface::loadRevision instead.

See also

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

File

core/modules/node/node.module, line 375
The core module that allows content to be submitted to the site.

Code

function node_revision_load($vid = NULL) {
  @trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \\Drupal\\Core\\Entity\\RevisionableStorageInterface::loadRevision instead. See https://www.drupal.org/node/3294237', E_USER_DEPRECATED);
  return \Drupal::entityTypeManager()
    ->getStorage('node')
    ->loadRevision($vid);
}