You are here

public function ModerationInformation::isLatestRevision in Workbench Moderation 8.2

Same name and namespace in other branches
  1. 8 src/ModerationInformation.php \Drupal\workbench_moderation\ModerationInformation::isLatestRevision()

Determines if an entity is a latest revision.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: A revisionable Content entity.

Return value

bool TRUE if the specified object is the latest revision of its entity, FALSE otherwise.

Overrides ModerationInformationInterface::isLatestRevision

1 call to ModerationInformation::isLatestRevision()
ModerationInformation::isLiveRevision in src/ModerationInformation.php
Determines if an entity is "live".

File

src/ModerationInformation.php, line 194

Class

ModerationInformation
General service for moderation-related questions about Entity API.

Namespace

Drupal\workbench_moderation

Code

public function isLatestRevision(ContentEntityInterface $entity) {
  return $entity
    ->getRevisionId() == $this
    ->getLatestRevisionId($entity
    ->getEntityTypeId(), $entity
    ->id());
}