You are here

function taxonomy_edge_get_tree in Taxonomy Edge 7.2

Same name and namespace in other branches
  1. 8 taxonomy_edge.module \taxonomy_edge_get_tree()
  2. 6 taxonomy_edge.module \taxonomy_edge_get_tree()
  3. 7 taxonomy_edge.module \taxonomy_edge_get_tree()

Reimplementation of taxonomy_get_tree(). Limit db fetch to only specified parent.

See also

taxonomy_get_tree()

1 string reference to 'taxonomy_edge_get_tree'
taxonomy_edge_core_override_info in ./taxonomy_edge.module
Implements hook_core_override().

File

./taxonomy_edge.module, line 874
Selecting all children of a given taxonomy term can be a pain. This module makes it easier to do this, by maintaining a complete list of edges for each term using the adjecency matrix graph theory.

Code

function taxonomy_edge_get_tree($vid, $parent = 0, $max_depth = NULL, $load_entities = FALSE) {

  // @todo Use regular taxonomy_get_tree if realtime build is disabled,
  //       as this function might be unreliable.
  module_load_include('core.inc', 'taxonomy_edge');

  // Use optimized version if possible
  if (variable_get('taxonomy_edge_optimized_get_tree', TAXONOMY_EDGE_OPTIMIZED_GET_TREE)) {
    return taxonomy_edge_get_tree_optimized($vid, $parent, $max_depth, $load_entities);
  }
  else {
    return taxonomy_edge_get_tree_generic($vid, $parent, $max_depth, $load_entities);
  }
}