You are here

public function ConfigEntityRevisionsStorage::getLatestPublishedRevision in Config Entity Revisions 8

Same name and namespace in other branches
  1. 1.x src/Entity/Handler/ConfigEntityRevisionsStorage.php \Drupal\config_entity_revisions\Entity\Handler\ConfigEntityRevisionsStorage::getLatestPublishedRevision()

Gets the latest published revision ID of the entity.

Parameters

int $config_entity_id: The config entity ID to match.

Return value

int The identifier of the latest published revision of the entity, or NULL if the entity does not have a published revision.

Overrides ConfigEntityRevisionsStorageInterface::getLatestPublishedRevision

File

src/Entity/Handler/ConfigEntityRevisionsStorage.php, line 48

Class

ConfigEntityRevisionsStorage
Class SqlConfigEntityRevisionsStorage

Namespace

Drupal\config_entity_revisions\Entity\Handler

Code

public function getLatestPublishedRevision($config_entity_id) {
  $revision = NULL;
  $revision_id = $this
    ->getLatestPublishedRevisionId($config_entity_id);
  if ($revision_id) {
    $revision = $this
      ->loadRevision($revision_id);
  }
  return $revision;
}