You are here

views_handler_argument_term_edge_node_tid_depth.inc in Taxonomy Edge 7.2

This file is a copy/override of the default views taxonomy argument handler.

Argument handler for taxonomy terms with depth using Taxonomy Edge.

File

views_taxonomy_edge/handlers/views_handler_argument_term_edge_node_tid_depth.inc
View source
<?php

/**
 * @file
 *
 * This file is a copy/override of the default views taxonomy argument handler.
 *
 * Argument handler for taxonomy terms with depth using Taxonomy Edge.
 *
 * @see views_handler_argument_term_node_tid_depth.inc
 * @ingroup views_argument_handlers
 */
class views_handler_argument_term_edge_node_tid_depth extends views_handler_argument_term_node_tid_depth {
  function query($group_by = FALSE) {
    if ($this->options['depth'] == 'all') {
      $this->options['depth'] = db_query("SELECT MAX(distance) FROM {taxonomy_term_edge}")
        ->fetchField();
    }
    elseif ($this->options['depth'] == 'root') {
      $this->options['depth'] = -db_query("SELECT MAX(distance) FROM {taxonomy_term_edge}")
        ->fetchField();
    }
    return parent::query($group_by);
  }

}