function InOperator::acceptExposedInput

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

Overrides FilterPluginBase::acceptExposedInput

2 calls to InOperator::acceptExposedInput()
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.
2 methods override InOperator::acceptExposedInput()
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 296

Class

InOperator
Simple 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.