You are here

public function FormsSteps::setStepCancelStep in Forms Steps 8

Sets a step's cancel step.

Parameters

string $step_id: The step ID to set the cancel step for.

\Drupal\forms_steps\Step $step: The step's cancel step.

Return value

\Drupal\forms_steps\StepInterface The forms_steps entity.

Overrides FormsStepsInterface::setStepCancelStep

File

src/Entity/FormsSteps.php, line 652

Class

FormsSteps
FormsSteps configuration entity to persistently store configuration.

Namespace

Drupal\forms_steps\Entity

Code

public function setStepCancelStep($step_id, Step $step = NULL) {
  if (!$step) {
    return $this;
  }
  if (!isset($this->steps[$step_id])) {
    throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
  }
  $this->steps[$step_id]['cancelStep'] = $step;
  return $this;
}