function InOperator::acceptExposedInput

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/filter/InOperator.php \Drupal\views\Plugin\views\filter\InOperator::acceptExposedInput()
  2. 8.9.x core/modules/views/src/Plugin/views/filter/InOperator.php \Drupal\views\Plugin\views\filter\InOperator::acceptExposedInput()
  3. 10 core/modules/views/src/Plugin/views/filter/InOperator.php \Drupal\views\Plugin\views\filter\InOperator::acceptExposedInput()

Determines if the input from a filter should change the generated query.

Parameters

array $input: The exposed data for this view.

Return value

bool TRUE if the input for this filter should be included in the view query. FALSE otherwise.

Overrides FilterPluginBase::acceptExposedInput

3 calls to InOperator::acceptExposedInput()
EntityReference::acceptExposedInput in core/modules/views/src/Plugin/views/filter/EntityReference.php
Determines if the input from a filter should change the generated query.
Name::acceptExposedInput in core/modules/user/src/Plugin/views/filter/Name.php
Determines if the input from a filter should change the generated query.
TaxonomyIndexTid::acceptExposedInput in core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
Determines if the input from a filter should change the generated query.
3 methods override InOperator::acceptExposedInput()
EntityReference::acceptExposedInput in core/modules/views/src/Plugin/views/filter/EntityReference.php
Determines if the input from a filter should change the generated query.
Name::acceptExposedInput in core/modules/user/src/Plugin/views/filter/Name.php
Determines if the input from a filter should change the generated query.
TaxonomyIndexTid::acceptExposedInput in core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
Determines if the input from a filter should change the generated query.

File

core/modules/views/src/Plugin/views/filter/InOperator.php, line 316

Class

InOperator
Filter to handle matching of multiple options selectable via checkboxes.

Namespace

Drupal\views\Plugin\views\filter

Code

public function acceptExposedInput($input) {
  if (empty($this->options['exposed'])) {
    return TRUE;
  }
  // The "All" state for this type of filter could have a default value. If
  // this is a non-multiple and non-required option, then this filter will
  // participate by using the default settings *if* 'limit' is true.
  if (empty($this->options['expose']['multiple']) && empty($this->options['expose']['required']) && !empty($this->options['expose']['limit'])) {
    $identifier = $this->options['expose']['identifier'];
    if ($input[$identifier] == 'All') {
      return TRUE;
    }
  }
  return parent::acceptExposedInput($input);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.