You are here

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

Same name and namespace in other branches
  1. 8.2 src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::setModerationState()
  2. 3.0.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::setModerationState()
  3. 3.1.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::setModerationState()
  4. 3.2.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::setModerationState()
  5. 3.3.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::setModerationState()
  6. 3.4.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::setModerationState()
  7. 3.5.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::setModerationState()
  8. 3.6.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::setModerationState()
  9. 3.7.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::setModerationState()
  10. 3.8.x src/Moderation/LingotekContentModerationHandler.php \Drupal\lingotek\Moderation\LingotekContentModerationHandler::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 LingotekContentModerationHandler::setModerationState()
LingotekContentModerationHandler::performModerationTransitionIfNeeded in src/Moderation/LingotekContentModerationHandler.php
Performs a moderation transition if needed.

File

src/Moderation/LingotekContentModerationHandler.php, line 165

Class

LingotekContentModerationHandler
Content moderation handler managing the Lingotek integration.

Namespace

Drupal\lingotek\Moderation

Code

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