You are here

public function FormsSteps::setStepPreviousState in Forms Steps 8

Set the previous state (hidden or displayed) of the step.

Parameters

int $step_id: Step id.

bool $state: State to set.

Return value

\Drupal\forms_steps\Entity\FormsSteps The forms steps.

Overrides FormsStepsInterface::setStepPreviousState

File

src/Entity/FormsSteps.php, line 816

Class

FormsSteps
FormsSteps configuration entity to persistently store configuration.

Namespace

Drupal\forms_steps\Entity

Code

public function setStepPreviousState($step_id, $state) {
  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]['displayPrevious'] = $state;
  return $this;
}