You are here

public function Date::query in Views XML Backend 8

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

Called to add the sort to a query.

Overrides Standard::query

File

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

Class

Date
Date sort plugin for views_xml_backend.

Namespace

Drupal\views_xml_backend\Plugin\views\sort

Code

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