You are here

public function MenuChildren::query in Views Menu Node Children Filter 8

Same name in this branch
  1. 8 src/Plugin/views/sort/MenuChildren.php \Drupal\views_menu_children_filter\Plugin\views\sort\MenuChildren::query()
  2. 8 src/Plugin/views/argument/MenuChildren.php \Drupal\views_menu_children_filter\Plugin\views\argument\MenuChildren::query()
Same name and namespace in other branches
  1. 8.2 src/Plugin/views/sort/MenuChildren.php \Drupal\views_menu_children_filter\Plugin\views\sort\MenuChildren::query()
  2. 3.0.x src/Plugin/views/sort/MenuChildren.php \Drupal\views_menu_children_filter\Plugin\views\sort\MenuChildren::query()

Called to add the sort to a query.

Overrides SortPluginBase::query

File

src/Plugin/views/sort/MenuChildren.php, line 58

Class

MenuChildren
Default implementation of the base sort plugin.

Namespace

Drupal\views_menu_children_filter\Plugin\views\sort

Code

public function query() {
  $this->joinHandler
    ->joinToNodeTable($this->query);
  $tables = $this->query->tables['node_field_data'];
  $this->query
    ->addOrderBy($tables['menu_link_content_data']['alias'], 'weight', $this->options['order']);
  $this->query
    ->addOrderBy($tables['node_field_data']['alias'], 'title', $this->options['order']);
  $this->query
    ->addOrderBy($tables['menu_link_content_data']['alias'], 'id', $this->options['order']);
}