class views_handler_join_nodehierarchy_ancestor in Node Hierarchy 6.3
Same name and namespace in other branches
- 7.2 includes/views/nodehierarchy.views.inc \views_handler_join_nodehierarchy_ancestor
Hierarchy
- class \views_handler_join_nodehierarchy_ancestor extends \views_join
Expanded class hierarchy of views_handler_join_nodehierarchy_ancestor
1 string reference to 'views_handler_join_nodehierarchy_ancestor'
- nodehierarchy_views_data in includes/
views/ nodehierarchy.views.inc - Implementation of hook_views_data()
File
- includes/
views/ nodehierarchy.views.inc, line 129 - Implementations of Views 2 Hooks for nodehierarchy_views module
View source
class views_handler_join_nodehierarchy_ancestor extends views_join {
// PHP 4 doesn't call constructors of the base class automatically from a
// constructor of a derived class. It is your responsibility to propagate
// the call to constructors upstream where appropriate.
function construct($table, $left_table) {
parent::construct($table, $left_table);
}
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;
}
}