You are here

protected function WizardPluginBase::retrieve_validated_view in Views (for Drupal 7) 8.3

Retrieves a validated view for a form submission.

Parameters

array $form: The full wizard form array.

array $form_state: The current state of the wizard form.

bool $unset: Should the view be removed from the list of validated views.

Return value

Drupal\views_ui\ViewUI $view The validated view object.

1 call to WizardPluginBase::retrieve_validated_view()
WizardPluginBase::create_view in lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php
Implements Drupal\views\Plugin\views\wizard\WizardInterface::create_view().

File

lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php, line 1036
Definition of Drupal\views\Plugin\views\wizard\WizardPluginBase.

Class

WizardPluginBase
Provides the interface and base class for Views Wizard plugins.

Namespace

Drupal\views\Plugin\views\wizard

Code

protected function retrieve_validated_view(array $form, array &$form_state, $unset = TRUE) {

  // @todo Figure out why all this hashing is done. Wouldn't it be easier to
  //   store a single entry and that's it?
  $key = hash('sha256', serialize($form_state['values']));
  $view = isset($this->validated_views[$key]) ? $this->validated_views[$key] : NULL;
  if ($unset) {
    unset($this->validated_views[$key]);
  }
  return $view;
}