You are here

public function LingotekContentModerationHandler::getModerationState in Lingotek Translation 3.5.x

Same name and namespace in other branches
  1. 8.2 src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
  2. 4.0.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
  3. 3.0.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
  4. 3.1.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
  5. 3.2.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
  6. 3.3.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
  7. 3.4.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
  8. 3.6.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
  9. 3.7.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::getModerationState()
  10. 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\Moderation

Code

public function getModerationState(ContentEntityInterface $entity) {
  $state = NULL;
  if ($this->moderationInfo
    ->isModeratedEntity($entity)) {
    $state = $entity
      ->get('moderation_state')
      ->getString();
  }
  return $state;
}