You are here

protected function FormStep::fetchSteps in Simple multi step form 8.x

Same name and namespace in other branches
  1. 8 src/FormStep.php \Drupal\simple_multistep\FormStep::fetchSteps()

Get array with form steps.

1 call to FormStep::fetchSteps()
FormStep::updateStepInfo in src/FormStep.php
Update step info.

File

src/FormStep.php, line 119

Class

FormStep
Class FormStep.

Namespace

Drupal\simple_multistep

Code

protected function fetchSteps() {
  $steps = array();
  if (isset($this->form['#fieldgroups']) && is_array($this->form['#fieldgroups'])) {
    foreach ($this->form['#fieldgroups'] as $field_group) {
      if ($field_group->format_type == 'form_step') {
        $steps[] = $field_group;
      }
    }
    usort($steps, array(
      $this,
      'sortStep',
    ));
  }
  $this->steps = $steps;
}