You are here

public function WorkflowTypeBase::getTransitionsForState in Drupal 10

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

File

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

Class

WorkflowTypeBase
A base class for Workflow type plugins.

Namespace

Drupal\workflows\Plugin

Code

public function getTransitionsForState($state_id, $direction = TransitionInterface::DIRECTION_FROM) {
  $transition_ids = array_keys(array_filter($this->configuration['transitions'], function ($transition) use ($state_id, $direction) {
    return in_array($state_id, (array) $transition[$direction], TRUE);
  }));
  return $this
    ->getTransitions($transition_ids);
}