public function LingotekContentModerationHandler::isModerationEnabled in Lingotek Translation 4.0.x
Same name and namespace in other branches
- 8.2 src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::isModerationEnabled()
- 3.0.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::isModerationEnabled()
- 3.1.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::isModerationEnabled()
- 3.2.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::isModerationEnabled()
- 3.3.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::isModerationEnabled()
- 3.4.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::isModerationEnabled()
- 3.5.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::isModerationEnabled()
- 3.6.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::isModerationEnabled()
- 3.7.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::isModerationEnabled()
- 3.8.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::isModerationEnabled()
Checks if the moderation is enabled for this entity.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The content entity.
Return value
bool If moderation is enabled, returns TRUE. Returns FALSE otherwise.
Overrides LingotekModerationHandlerInterface::isModerationEnabled
1 call to LingotekContentModerationHandler::isModerationEnabled()
- LingotekContentModerationHandler::shouldModerationPreventUpload in src/
Moderation/ LingotekContentModerationHandler.php - Checks if we should prevent upload based on content moderation settings.
File
- src/
Moderation/ LingotekContentModerationHandler.php, line 172
Class
- LingotekContentModerationHandler
- Content moderation handler managing the Lingotek integration.
Namespace
Drupal\lingotek\ModerationCode
public function isModerationEnabled(EntityInterface $entity) {
$moderationEnabled = FALSE;
$moderationClass = $entity
->getEntityType()
->getHandlerClass('moderation');
if ($moderationClass) {
$implements = class_implements($moderationClass);
$moderationEnabled = in_array('Drupal\\content_moderation\\Entity\\Handler\\ModerationHandlerInterface', $implements);
}
return $moderationEnabled;
}