ModerationInformation::isModeratedEntity

public ModerationInformation::isModeratedEntity(EntityInterface $entity)

Determines if an entity is moderated.

Parameters

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

Return value

bool TRUE if this entity is moderated, FALSE otherwise.

Overrides ModerationInformationInterface::isModeratedEntity

File

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

Class

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

Namespace

Drupal\content_moderation

Code

public function isModeratedEntity(EntityInterface $entity) {
  if (!$entity instanceof ContentEntityInterface) {
    return FALSE;
  }

  return $this->shouldModerateEntitiesOfBundle($entity->getEntityType(), $entity->bundle());
}
doc_Drupal
2016-10-29 09:28:33
Comments
Leave a Comment

Please login to continue.