function WizardPluginBase::retrieveValidatedView
Same name in other branches
- 9 core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php \Drupal\views\Plugin\views\wizard\WizardPluginBase::retrieveValidatedView()
- 8.9.x core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php \Drupal\views\Plugin\views\wizard\WizardPluginBase::retrieveValidatedView()
- 11.x core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php \Drupal\views\Plugin\views\wizard\WizardPluginBase::retrieveValidatedView()
Retrieves a validated view for a form submission.
Parameters
array $form: The full wizard form array.
\Drupal\Core\Form\FormStateInterface $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 The validated view object.
1 call to WizardPluginBase::retrieveValidatedView()
- WizardPluginBase::createView in core/
modules/ views/ src/ Plugin/ views/ wizard/ WizardPluginBase.php - Creates a view from values that have already been validated.
File
-
core/
modules/ views/ src/ Plugin/ views/ wizard/ WizardPluginBase.php, line 1252
Class
- WizardPluginBase
- Base class for Views wizard plugins.
Namespace
Drupal\views\Plugin\views\wizardCode
protected function retrieveValidatedView(array $form, FormStateInterface $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->getValues()));
$view = $this->validated_views[$key] ?? NULL;
if ($unset) {
unset($this->validated_views[$key]);
}
return $view;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.