You are here

public function Numeric::query in Views XML Backend 8

Same name in this branch
  1. 8 src/Plugin/views/filter/Numeric.php \Drupal\views_xml_backend\Plugin\views\filter\Numeric::query()
  2. 8 src/Plugin/views/sort/Numeric.php \Drupal\views_xml_backend\Plugin\views\sort\Numeric::query()

Called to add the sort to a query.

Overrides Standard::query

File

src/Plugin/views/sort/Numeric.php, line 24
Contains \Drupal\views_xml_backend\Plugin\views\sort\Numeric.

Class

Numeric
Numeric sort plugin for XML.

Namespace

Drupal\views_xml_backend\Plugin\views\sort

Code

public function query() {
  $alias = 'sort_numeric_' . $this->options['id'];
  $this->query
    ->addField($alias, $this->options['xpath_selector']);
  $this->query
    ->addSort(new NumericSorter($alias, $this->options['order']));
}