You are here

public function ContentModerationState::getTransitionTo in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/content_moderation/src/ContentModerationState.php \Drupal\content_moderation\ContentModerationState::getTransitionTo()

Gets the Transition object for the provided state ID.

Parameters

$to_state_id: The state to transition to.

Return value

\Drupal\workflows\TransitionInterface The Transition object for the provided state ID.

Throws

\InvalidArgumentException() Exception thrown when the provided state ID can not be transitioned to.

Overrides StateInterface::getTransitionTo

File

core/modules/content_moderation/src/ContentModerationState.php, line 103

Class

ContentModerationState
A value object representing a workflow state for content moderation.

Namespace

Drupal\content_moderation

Code

public function getTransitionTo($to_state_id) {
  return $this->state
    ->getTransitionTo($to_state_id);
}