You are here

public function StateItem::getTransitions in State Machine 8

Gets the allowed transitions for the current state.

Return value

\Drupal\state_machine\Plugin\Workflow\WorkflowTransition[] The allowed transitions, keyed by transition ID.

Overrides StateItemInterface::getTransitions

1 call to StateItem::getTransitions()
StateItem::isTransitionAllowed in src/Plugin/Field/FieldType/StateItem.php
Gets whether the given transition is allowed.

File

src/Plugin/Field/FieldType/StateItem.php, line 308

Class

StateItem
Plugin implementation of the 'state' field type.

Namespace

Drupal\state_machine\Plugin\Field\FieldType

Code

public function getTransitions() {
  $transitions = [];
  if ($workflow = $this
    ->getWorkflow()) {
    $transitions = $workflow
      ->getAllowedTransitions($this->value, $this
      ->getEntity());
  }
  return $transitions;
}