function WorkflowTypeBase::getTransitions

Same name and namespace in other branches
  1. 9 core/modules/workflows/src/Plugin/WorkflowTypeBase.php \Drupal\workflows\Plugin\WorkflowTypeBase::getTransitions()
  2. 8.9.x core/modules/workflows/src/Plugin/WorkflowTypeBase.php \Drupal\workflows\Plugin\WorkflowTypeBase::getTransitions()
  3. 11.x core/modules/workflows/src/Plugin/WorkflowTypeBase.php \Drupal\workflows\Plugin\WorkflowTypeBase::getTransitions()

Gets transition objects for the provided transition IDs.

Parameters

string[] $transition_ids: A list of transition IDs to get. If NULL then all transitions will be returned.

Return value

\Drupal\workflows\TransitionInterface[] An array of transition objects.

Overrides WorkflowTypeInterface::getTransitions

1 call to WorkflowTypeBase::getTransitions()
WorkflowTypeBase::getTransitionsForState in core/modules/workflows/src/Plugin/WorkflowTypeBase.php
Gets the transitions for a state for the provided direction.

File

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

Class

WorkflowTypeBase
A base class for Workflow type plugins.

Namespace

Drupal\workflows\Plugin

Code

public function getTransitions(?array $transition_ids = NULL) {
  if ($transition_ids === NULL) {
    $transition_ids = array_keys($this->configuration['transitions']);
  }
  /** @var \Drupal\workflows\TransitionInterface[] $transitions */
  $transitions = array_combine($transition_ids, array_map([
    $this,
    'getTransition',
  ], $transition_ids));
  return static::labelWeightMultisort($transitions);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.