You are here

function views_handler_join_nodehierarchy_ancestor::join in Node Hierarchy 6.3

File

includes/views/nodehierarchy.views.inc, line 137
Implementations of Views 2 Hooks for nodehierarchy_views module

Class

views_handler_join_nodehierarchy_ancestor

Code

function join($table, &$query) {
  $left = $query
    ->get_table_info($this->left_table);
  $on = array();
  for ($i = 1; $i < MENU_MAX_DEPTH; $i++) {
    $on[] = "{$left['alias']}.p{$i} = {$table['alias']}.mlid";
  }
  $output = " {$this->type} JOIN {" . $this->table . "} {$table['alias']} ON (" . implode(' OR ', $on) . ") AND {$left['alias']}.mlid != {$table['alias']}.mlid";
  return $output;
}