function taxonomy_edge_is_order_valid in Taxonomy Edge 7
Same name and namespace in other branches
- 8 taxonomy_edge.module \taxonomy_edge_is_order_valid()
- 6 taxonomy_edge.module \taxonomy_edge_is_order_valid()
- 7.2 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().
File
- ./
taxonomy_edge.module, line 777 - Optimization of taxonomy data model for SQL performance.
Code
function taxonomy_edge_is_order_valid($vid, $reset = FALSE) {
static $valid_orders = array();
if ($reset || !isset($valid_orders[$vid])) {
$valid_orders[$vid] = db_query_range("SELECT 1 FROM {taxonomy_term_edge_order} WHERE vid = :vid", 0, 1, array(
':vid' => -$vid,
))
->fetchField();
}
return $valid_orders[$vid];
}