You are here

function taxonomy_edge_is_order_valid in Taxonomy Edge 6

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

Check if our sorted tree is still valid

3 calls to taxonomy_edge_is_order_valid()
TaxonomyEdgeTreeTestCase::testOrder in tests/tree.test
taxonomy_edge_cron in ./taxonomy_edge.module
Implements hook_cron().
taxonomy_edge_get_tree_optimized in ./taxonomy_edge.core.inc
Reimplementation of taxonomy_get_tree(). Limit db fetch to only specified parent AND use presorting.

File

./taxonomy_edge.module, line 704
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_is_order_valid($vid, $reset = FALSE) {
  static $valid_orders = array();
  if ($reset || !isset($valid_orders[$vid])) {
    $valid_orders[$vid] = db_result(db_query_range("SELECT 1 FROM {term_edge_order} WHERE vid = %d", -$vid, 0, 1));
  }
  return $valid_orders[$vid];
}