You are here

function taxonomy_edge_get_max_depth in Taxonomy Edge 7.2

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

Get max depth of vocabulary.

Parameters

$vid: Vocabulary ID

Return value

Max depth (distance)

2 calls to taxonomy_edge_get_max_depth()
taxonomy_edge_term_feed in ./taxonomy_edge.pages.inc
Generate the content feed for a taxonomy term.
taxonomy_edge_term_page in ./taxonomy_edge.pages.inc
Menu callback; displays all nodes associated with a term.

File

./taxonomy_edge.module, line 726
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_max_depth($vid) {
  return db_query("SELECT MAX(distance) FROM {taxonomy_term_edge} WHERE vid = :vid", array(
    ':vid' => $vid,
  ))
    ->fetchField();
}