public function LingotekContentModerationHandler::getModerationState in Lingotek Translation 3.7.x
Same name and namespace in other branches
- 8.2 src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
- 4.0.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
- 3.0.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
- 3.1.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
- 3.2.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
- 3.3.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
- 3.4.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
- 3.5.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
- 3.6.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
- 3.8.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
Gets the moderation state ID.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: The content entity.
Return value
string The moderation state ID.
Overrides LingotekModerationHandlerInterface::getModerationState
2 calls to LingotekContentModerationHandler::getModerationState()
- LingotekContentModerationHandler::performModerationTransitionIfNeeded in src/
Moderation/ LingotekContentModerationHandler.php - Performs a moderation transition if needed.
- LingotekContentModerationHandler::shouldModerationPreventUpload in src/
Moderation/ LingotekContentModerationHandler.php - Checks if we should prevent upload based on content moderation settings.
File
- src/
Moderation/ LingotekContentModerationHandler.php, line 154
Class
- LingotekContentModerationHandler
- Content moderation handler managing the Lingotek integration.
Namespace
Drupal\lingotek\ModerationCode
public function getModerationState(ContentEntityInterface $entity) {
$state = NULL;
if ($this->moderationInfo
->isModeratedEntity($entity)) {
$state = $entity
->get('moderation_state')
->getString();
}
return $state;
}