You are here

public function ContentEntityStorageBase::loadRevision in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php \Drupal\Core\Entity\ContentEntityStorageBase::loadRevision()

Load a specific entity revision.

@todo Deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface instead.

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

See also

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

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

1 call to ContentEntityStorageBase::loadRevision()
ContentEntityStorageBase::deleteRevision in core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
Delete a specific entity revision.
1 method overrides ContentEntityStorageBase::loadRevision()
ContentEntityNullStorage::loadRevision in core/lib/Drupal/Core/Entity/ContentEntityNullStorage.php
Load a specific entity revision.

File

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

Class

ContentEntityStorageBase
Base class for content entity storage handlers.

Namespace

Drupal\Core\Entity

Code

public function loadRevision($revision_id) {
  $revisions = $this
    ->loadMultipleRevisions([
    $revision_id,
  ]);
  return isset($revisions[$revision_id]) ? $revisions[$revision_id] : NULL;
}