public function LingotekWorkbenchModerationHandler::shouldModerationPreventUpload in Lingotek Translation 3.6.x
Same name and namespace in other branches
- 8.2 src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::shouldModerationPreventUpload()
- 4.0.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::shouldModerationPreventUpload()
- 3.1.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::shouldModerationPreventUpload()
- 3.2.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::shouldModerationPreventUpload()
- 3.3.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::shouldModerationPreventUpload()
- 3.4.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::shouldModerationPreventUpload()
- 3.5.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::shouldModerationPreventUpload()
- 3.7.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::shouldModerationPreventUpload()
- 3.8.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::shouldModerationPreventUpload()
Checks if we should prevent upload based on content moderation settings.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The content entity.
Return value
bool Returns TRUE if we should prevent the upload based on content moderation.
Overrides LingotekModerationHandlerInterface::shouldModerationPreventUpload
File
- src/
Moderation/ LingotekWorkbenchModerationHandler.php, line 67
Class
- LingotekWorkbenchModerationHandler
- Workbench moderation handler managing the Lingotek integration.
Namespace
Drupal\lingotek\ModerationCode
public function shouldModerationPreventUpload(EntityInterface $entity) {
$prevent = FALSE;
if ($this->moduleHandler
->moduleExists('workbench_moderation')) {
$moderationEnabled = $this
->isModerationEnabled($entity);
if ($moderationEnabled) {
$uploadStatus = $this->moderationConfiguration
->getUploadStatus($entity
->getEntityTypeId(), $entity
->bundle());
$state = $this
->getModerationState($entity);
if ($state !== $uploadStatus) {
$prevent = TRUE;
}
}
}
return $prevent;
}