diff --git a/core/modules/workflows/src/Plugin/WorkflowTypeBase.php b/core/modules/workflows/src/Plugin/WorkflowTypeBase.php index 5810938d..e7c37a62 100644 --- a/core/modules/workflows/src/Plugin/WorkflowTypeBase.php +++ b/core/modules/workflows/src/Plugin/WorkflowTypeBase.php @@ -7,6 +7,7 @@ use Drupal\workflows\State; use Drupal\workflows\StateInterface; use Drupal\workflows\Transition; +use Drupal\workflows\TransitionInterface; use Drupal\workflows\WorkflowInterface; use Drupal\workflows\WorkflowTypeInterface; @@ -314,7 +315,7 @@ public function hasTransition($transition_id) { /** * {@inheritdoc} */ - public function getTransitionsForState($state_id, $direction = 'from') { + 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); })); diff --git a/core/modules/workflows/src/WorkflowTypeInterface.php b/core/modules/workflows/src/WorkflowTypeInterface.php index 5d5439d7..134e2b1f 100644 --- a/core/modules/workflows/src/WorkflowTypeInterface.php +++ b/core/modules/workflows/src/WorkflowTypeInterface.php @@ -248,8 +248,12 @@ public function getTransitions(array $transition_ids = NULL); * @param $state_id * The state to get transitions for. * @param string $direction - * (optional) The direction of the transition. Defaults to 'from'. Possible - * values are: 'from' and 'to'. + * (optional) The direction of the transition. Defaults to + * \Drupal\workflows\TransitionInterface\TransitionInterface::DIRECTION_FROM. + * Possible values are: + * \Drupal\workflows\TransitionInterface\TransitionInterface::DIRECTION_FROM + * or + * \Drupal\workflows\TransitionInterface\TransitionInterface::DIRECTION_TO. * * @return array * The transition IDs for a state for the provided direction.