function FormWizardBase::populateCachedValues

Same name in other branches
  1. 4.0.x src/Wizard/FormWizardBase.php \Drupal\ctools\Wizard\FormWizardBase::populateCachedValues()

Overrides FormWizardInterface::populateCachedValues

File

src/Wizard/FormWizardBase.php, line 315

Class

FormWizardBase
The base class for all form wizard.

Namespace

Drupal\ctools\Wizard

Code

public function populateCachedValues(array &$form, FormStateInterface $form_state) {
    $cached_values = $this->getTempstore()
        ->get($this->getMachineName());
    if (!$cached_values) {
        $cached_values = $form_state->getTemporaryValue('wizard');
        if (!$cached_values) {
            $cached_values = $this->initValues();
            $form_state->setTemporaryValue('wizard', $cached_values);
        }
    }
}