public function ModerationInformation::isLatestRevision in Workbench Moderation 8
Same name and namespace in other branches
- 8.2 src/ModerationInformation.php \Drupal\workbench_moderation\ModerationInformation::isLatestRevision()
Determines if an entity is a latest revision.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $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 193
Class
- ModerationInformation
- General service for moderation-related questions about Entity API.
Namespace
Drupal\workbench_moderationCode
public function isLatestRevision(ContentEntityInterface $entity) {
return $entity
->getRevisionId() == $this
->getLatestRevisionId($entity
->getEntityTypeId(), $entity
->id());
}