ModerationInformation::hasForwardRevision

public ModerationInformation::hasForwardRevision(ContentEntityInterface $entity)

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

core/modules/content_moderation/src/ModerationInformation.php, line 117

Class

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

Namespace

Drupal\content_moderation

Code

public function hasForwardRevision(ContentEntityInterface $entity) {
  return $this->isModeratedEntity($entity)
    && !($this->getLatestRevisionId($entity->getEntityTypeId(), $entity->id()) == $this->getDefaultRevisionId($entity->getEntityTypeId(), $entity->id()));
}
doc_Drupal
2016-10-29 09:28:33
Comments
Leave a Comment

Please login to continue.