public function ContentEntityStorageBase::loadRevision

public ContentEntityStorageBase::loadRevision($revision_id)

Load a specific entity revision.

Parameters

int|string $revision_id: The revision id.

Return value

\Drupal\Core\Entity\EntityInterface|null The specified entity revision or NULL if not found.

Overrides EntityStorageInterface::loadRevision

File

core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php, line 218

Class

ContentEntityStorageBase
Base class for content entity storage handlers.

Namespace

Drupal\Core\Entity

Code

public function loadRevision($revision_id) {
  $revision = $this->doLoadRevisionFieldItems($revision_id);

  if ($revision) {
    $entities = [$revision->id() => $revision];
    $this->invokeStorageLoadHook($entities);
    $this->postLoad($entities);
  }

  return $revision;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!ContentEntityStorageBase.php/function/ContentEntityStorageBase::loadRevision/8.1.x