You are here

public function LingotekWorkbenchModerationHandler::setModerationState in Lingotek Translation 4.0.x

Same name and namespace in other branches
  1. 8.2 src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::setModerationState()
  2. 3.1.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::setModerationState()
  3. 3.2.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::setModerationState()
  4. 3.3.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::setModerationState()
  5. 3.4.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::setModerationState()
  6. 3.5.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::setModerationState()
  7. 3.6.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::setModerationState()
  8. 3.7.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::setModerationState()
  9. 3.8.x src/Moderation/LingotekWorkbenchModerationHandler.php \Drupal\lingotek\Moderation\LingotekWorkbenchModerationHandler::setModerationState()

Sets the moderation state ID.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The content entity.

string $state: The moderation state ID.

Overrides LingotekModerationHandlerInterface::setModerationState

1 call to LingotekWorkbenchModerationHandler::setModerationState()
LingotekWorkbenchModerationHandler::performModerationTransitionIfNeeded in src/Moderation/LingotekWorkbenchModerationHandler.php
Performs a moderation transition if needed.

File

src/Moderation/LingotekWorkbenchModerationHandler.php, line 110

Class

LingotekWorkbenchModerationHandler
Workbench moderation handler managing the Lingotek integration.

Namespace

Drupal\lingotek\Moderation

Code

public function setModerationState(ContentEntityInterface $entity, $state) {
  $entity
    ->set('moderation_state', $state);
}