function WorkflowTypeBase::deleteTransition

Deletes a transition.

Parameters

string $transition_id: The transition ID.

Return value

$this

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 426

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;
}

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