You are here

public function ModerationInformation::hasForwardRevision in Workbench Moderation 8

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

Determines if a forward revision exists for the specified entity.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The entity which may or may not have a forward revision.

Return value

bool TRUE if this entity has forward revisions available, FALSE otherwise.

Overrides ModerationInformationInterface::hasForwardRevision

File

src/ModerationInformation.php, line 200

Class

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

Namespace

Drupal\workbench_moderation

Code

public function hasForwardRevision(ContentEntityInterface $entity) {
  return $this
    ->isModeratableEntity($entity) && !($this
    ->getLatestRevisionId($entity
    ->getEntityTypeId(), $entity
    ->id()) == $this
    ->getDefaultRevisionId($entity
    ->getEntityTypeId(), $entity
    ->id()));
}