You are here

function node_revision_load in Drupal 8

Same name and namespace in other branches
  1. 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.

7 calls to node_revision_load()
FileFieldRevisionTest::testRevisions in core/modules/file/tests/src/Functional/FileFieldRevisionTest.php
Tests creating multiple revisions of a node and managing attached files.
NodeEditFormTest::testNodeEdit in core/modules/node/tests/src/Functional/NodeEditFormTest.php
Checks node edit functionality.
NodeRevisionsAllTest::testRevisions in core/modules/node/tests/src/Functional/NodeRevisionsAllTest.php
Checks node revision operations.
NodeRevisionsTest::testRevisions in core/modules/node/tests/src/Functional/NodeRevisionsTest.php
Checks node revision related operations.
UserCancelTest::testUserAnonymize in core/modules/user/tests/src/Functional/UserCancelTest.php
Delete account and anonymize all content.

... See full list

File

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

Code

function node_revision_load($vid = NULL) {
  return \Drupal::entityTypeManager()
    ->getStorage('node')
    ->loadRevision($vid);
}