Determines whether an entity is moderated.
\Drupal\Core\Entity\EntityInterface $entity: The entity.
bool TRUE if the entity is moderated. Otherwise, FALSE.
public static function isModeratedEntity(EntityInterface $entity) {
if (!\Drupal::moduleHandler()
->moduleExists('content_moderation')) {
return FALSE;
}
return \Drupal::service('content_moderation.moderation_information')
->isModeratedEntity($entity);
}