views_join_term_edge.inc in Taxonomy Edge 6
File
views_taxonomy_edge/handlers/views_join_term_edge.inc
View source
<?php
class views_join_term_edge extends views_join {
function join($table, &$query) {
$found = FALSE;
foreach ($query->where as $data) {
foreach ($data['clauses'] as $condition) {
if (strpos($condition, $table['alias'] . '.parent ') !== FALSE) {
$found = TRUE;
break;
}
}
}
$result = parent::join($table, $query);
$result .= ' AND ' . $table['alias'] . '.vid = ' . $this->left_table . '.vid';
if (!$found) {
$result .= ' AND ' . $table['alias'] . '.parent = 0 ';
}
return $result;
}
}