You are here

public function FormsSteps::getProgressStep in Forms Steps 8

Gets a forms_steps progress step.

Parameters

string $progress_step_id: The progress step's ID.

Return value

\Drupal\forms_steps\ProgressStepInterface The forms_steps progress step.

Throws

\InvalidArgumentException Thrown if $progress_step_id does not exist.

Overrides FormsStepsInterface::getProgressStep

File

src/Entity/FormsSteps.php, line 476

Class

FormsSteps
FormsSteps configuration entity to persistently store configuration.

Namespace

Drupal\forms_steps\Entity

Code

public function getProgressStep($progress_step_id) {
  if (!isset($this->progress_steps[$progress_step_id])) {
    throw new \InvalidArgumentException("The progress step '{$progress_step_id}' does not exist in forms steps '{$this->id()}'");
  }
  $progress_step = new ProgressStep($this, $progress_step_id, $this->progress_steps[$progress_step_id]['label'], $this->progress_steps[$progress_step_id]['weight'], isset($this->progress_steps[$progress_step_id]['routes']) ? $this->progress_steps[$progress_step_id]['routes'] : [], isset($this->progress_steps[$progress_step_id]['link']) ? $this->progress_steps[$progress_step_id]['link'] : '', isset($this->progress_steps[$progress_step_id]['link_visibility']) ? $this->progress_steps[$progress_step_id]['link_visibility'] : []);
  return $progress_step;
}