You are here

public function WorkflowTypeBase::getTransitionFromStateToState in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/workflows/src/Plugin/WorkflowTypeBase.php \Drupal\workflows\Plugin\WorkflowTypeBase::getTransitionFromStateToState()
  2. 9 core/modules/workflows/src/Plugin/WorkflowTypeBase.php \Drupal\workflows\Plugin\WorkflowTypeBase::getTransitionFromStateToState()

File

core/modules/workflows/src/Plugin/WorkflowTypeBase.php, line 346

Class

WorkflowTypeBase
A base class for Workflow type plugins.

Namespace

Drupal\workflows\Plugin

Code

public function getTransitionFromStateToState($from_state_id, $to_state_id) {
  $transition_id = $this
    ->getTransitionIdFromStateToState($from_state_id, $to_state_id);
  if (empty($transition_id)) {
    throw new \InvalidArgumentException("The transition from '{$from_state_id}' to '{$to_state_id}' does not exist in workflow.");
  }
  return $this
    ->getTransition($transition_id);
}