function views_handler_sort_menu_hierarchy::query

3.x views_handler_sort_menu_hierarchy.inc views_handler_sort_menu_hierarchy::query()
2.x views_handler_sort_menu_hierarchy.inc views_handler_sort_menu_hierarchy::query()

Called to add the sort to a query.

Overrides views_handler_sort::query

File

handlers/views_handler_sort_menu_hierarchy.inc, line 12

Class

views_handler_sort_menu_hierarchy
Sort in menu hierarchy order.

Code

function query() {
  $this->ensure_my_table();
  $max_depth = isset($this->definition['max depth']) ? $this->definition['max depth'] : MENU_MAX_DEPTH;
  for ($i = 1; $i <= $max_depth; ++$i) {
    $this->query->add_orderby($this->table_alias, $this->field . $i, $this->options['order']);
  }
}