You are here

private function ContentModerationIPEAccess::isLatestRevision in Lightning Workflow 8.3

Determines if an entity is the latest revision.

This is a shim around RevisionableInterface::isLatestRevision() and ModerationInformationInterface::isLatestRevision(). The former is added in Drupal 8.8, deprecating the latter.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to check.

Return value

bool TRUE if the entity is the latest revision, FALSE otherwise.

1 call to ContentModerationIPEAccess::isLatestRevision()
ContentModerationIPEAccess::access in src/Plugin/IPEAccess/ContentModerationIPEAccess.php

File

src/Plugin/IPEAccess/ContentModerationIPEAccess.php, line 104

Class

ContentModerationIPEAccess
Provides Panels IPE access logic for Content Moderation integration.

Namespace

Drupal\lightning_workflow\Plugin\IPEAccess

Code

private function isLatestRevision(EntityInterface $entity) {
  return $entity instanceof RevisionableInterface && method_exists($entity, 'isLatestRevision') ? $entity
    ->isLatestRevision() : call_user_func([
    $this->information,
    'isLatestRevision',
  ], $entity);
}