function taxonomy_term_depth_handler_filter_has_children::query in Taxonomy Term Depth 7
Add this filter to the query.
Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.
Overrides views_handler_filter_boolean_operator::query
File
- includes/
taxonomy_term_depth_handler_filter_has_children.inc, line 11 - Filter by whether term has children.
Class
- taxonomy_term_depth_handler_filter_has_children
- @file Filter by whether term has children.
Code
function query() {
$this
->ensure_my_table();
$this->query
->add_where_expression($this->options['group'], "(SELECT count(th.tid) FROM taxonomy_term_hierarchy th WHERE th.parent = {$this->table_alias}.{$this->real_field}) = {$this->value}");
}