You are here

public function WorkflowTypeBase::deleteTransition in Drupal 8

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

Deletes a transition.

Parameters

string $transition_id: The transition ID.

Return value

$this

Throws

\InvalidArgumentException Thrown if the transition does not exist.

Overrides WorkflowTypeInterface::deleteTransition

1 call to WorkflowTypeBase::deleteTransition()
WorkflowTypeBase::deleteState in core/modules/workflows/src/Plugin/WorkflowTypeBase.php
Deletes a state from the workflow.

File

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

Class

WorkflowTypeBase
A base class for Workflow type plugins.

Namespace

Drupal\workflows\Plugin

Code

public function deleteTransition($transition_id) {
  if (!$this
    ->hasTransition($transition_id)) {
    throw new \InvalidArgumentException("The transition '{$transition_id}' does not exist in workflow.");
  }
  unset($this->configuration['transitions'][$transition_id]);
  return $this;
}