public static function views_menu_children_argument::joinMenuLinksTableToNode in Views Menu Node Children Filter 7
Parameters
\views_plugin_query $query:
string $menu_name The menu's machine name we want to filter by.:
bool $allow_duplicate_join If "false", prevents this join from joining more than once if this function is called repeatedly.:
2 calls to views_menu_children_argument::joinMenuLinksTableToNode()
- views_menu_children_argument::query in includes/
views_menu_children_argument.inc - Set up the query for this argument.
- views_menu_children_sort_handler::query in includes/
views_menu_children_sort_handler.inc - Called to add the sort to a query.
File
- includes/
views_menu_children_argument.inc, line 149
Class
Code
public static function joinMenuLinksTableToNode(\views_plugin_query $query, $menu_name, $allow_duplicate_join = false) {
// Because this can be called from the argument and sort handlers,
// first check to see if the join as already been applied.
if (!$allow_duplicate_join && isset($query->tables['node']['menu_links'])) {
return;
}
// We need to join on the menu_links table.
// Use our special views_join object to accomplish this.
$join = new views_menu_children_join();
$join->prefixes[] = 'node/';
drupal_alter('views_menu_children_filter_join', $join->prefixes, $menu_name, $query);
$query
->queue_table("menu_links", "node", $join);
$query
->add_where_expression(0, "menu_links.menu_name = :targetmenu", array(
':targetmenu' => $menu_name,
));
}