function node_revision_load
Same name in other branches
- 9 core/modules/node/node.module \node_revision_load()
- 8.9.x 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
1 call to node_revision_load()
- NodeDeprecationTest::testNodeRevisionLoadDeprecation in core/
modules/ node/ tests/ src/ Kernel/ NodeDeprecationTest.php - Tests the deprecation of node_revision_load.
File
-
core/
modules/ node/ node.module, line 375
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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.