You are here

public function ModerationInformation::isModeratableEntity in Workbench Moderation 8

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

Determines if an entity is one we should be moderating.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity we may be moderating.

Return value

bool TRUE if this is an entity that we should act upon, FALSE otherwise.

Overrides ModerationInformationInterface::isModeratableEntity

2 calls to ModerationInformation::isModeratableEntity()
ModerationInformation::hasForwardRevision in src/ModerationInformation.php
Determines if a forward revision exists for the specified entity.
ModerationInformation::isModeratedEntityForm in src/ModerationInformation.php
Determines if this form is for a moderated entity.

File

src/ModerationInformation.php, line 54

Class

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

Namespace

Drupal\workbench_moderation

Code

public function isModeratableEntity(EntityInterface $entity) {
  if (!$entity instanceof ContentEntityInterface) {
    return FALSE;
  }
  return $this
    ->isModeratableBundle($entity
    ->getEntityType(), $entity
    ->bundle());
}