You are here

public function NumericFilter::query in Drupal 9

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

Add this filter to the query.

Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.

Overrides FilterPluginBase::query

2 methods override NumericFilter::query()
GroupByNumeric::query in core/modules/views/src/Plugin/views/filter/GroupByNumeric.php
Add this filter to the query.
StatisticsLastUpdated::query in core/modules/comment/src/Plugin/views/filter/StatisticsLastUpdated.php
Add this filter to the query.

File

core/modules/views/src/Plugin/views/filter/NumericFilter.php, line 324

Class

NumericFilter
Simple filter to handle greater than/less than filters.

Namespace

Drupal\views\Plugin\views\filter

Code

public function query() {
  $this
    ->ensureMyTable();
  $field = "{$this->tableAlias}.{$this->realField}";
  $info = $this
    ->operators();
  if (!empty($info[$this->operator]['method'])) {
    $this
      ->{$info[$this->operator]['method']}($field);
  }
}