You are here

protected function WizardPluginBase::defaultDisplayFilters in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php \Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayFilters()
  2. 9 core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php \Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayFilters()

Retrieves all filter information used by the default display.

Additional to the one provided by the plugin this method takes care about adding additional filters based on user input.

Parameters

array $form: The full wizard form array.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the wizard form.

Return value

array An array of filter arrays keyed by ID. A sort array contains the options accepted by a filter handler.

1 call to WizardPluginBase::defaultDisplayFilters()
WizardPluginBase::buildDisplayOptions in core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
Builds an array of display options for the view.

File

core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php, line 893

Class

WizardPluginBase
Base class for Views wizard plugins.

Namespace

Drupal\views\Plugin\views\wizard

Code

protected function defaultDisplayFilters($form, FormStateInterface $form_state) {
  $filters = [];

  // Add any filters provided by the plugin.
  foreach ($this
    ->getFilters() as $name => $info) {
    $filters[$name] = $info;
  }

  // Add any filters specified by the user when filling out the wizard.
  $filters = array_merge($filters, $this
    ->defaultDisplayFiltersUser($form, $form_state));
  return $filters;
}