function InputRequired::query

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/exposed_form/InputRequired.php \Drupal\views\Plugin\views\exposed_form\InputRequired::query()
  2. 8.9.x core/modules/views/src/Plugin/views/exposed_form/InputRequired.php \Drupal\views\Plugin\views\exposed_form\InputRequired::query()
  3. 10 core/modules/views/src/Plugin/views/exposed_form/InputRequired.php \Drupal\views\Plugin\views\exposed_form\InputRequired::query()

Overrides ExposedFormPluginBase::query

File

core/modules/views/src/Plugin/views/exposed_form/InputRequired.php, line 103

Class

InputRequired
Exposed form plugin that provides an exposed form with required input.

Namespace

Drupal\views\Plugin\views\exposed_form

Code

public function query() {
    if (!$this->exposedFilterApplied()) {
        // We return with no query; this will force the empty text.
        $this->view->built = TRUE;
        $this->view->executed = TRUE;
        $this->view->result = [];
    }
    else {
        parent::query();
    }
}

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