You are here

public function InputRequired::query in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/exposed_form/InputRequired.php \Drupal\views\Plugin\views\exposed_form\InputRequired::query()

Add anything to the query that we might need to.

Overrides ExposedFormPluginBase::query

File

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

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();
  }
}