function taxonomy_edge_is_build_realtime in Taxonomy Edge 8
Same name and namespace in other branches
- 6 taxonomy_edge.module \taxonomy_edge_is_build_realtime()
- 7.2 taxonomy_edge.module \taxonomy_edge_is_build_realtime()
- 7 taxonomy_edge.module \taxonomy_edge_is_build_realtime()
Checks if it's possible to build an edge realtime.
Return value
boolean TRUE if possible, FALSE if not.
3 calls to taxonomy_edge_is_build_realtime()
- taxonomy_edge_taxonomy_term_delete in ./
taxonomy_edge.module - Implements hook_taxonomy_term_delete().
- taxonomy_edge_taxonomy_term_insert in ./
taxonomy_edge.module - Implements hook_taxonomy_term_insert().
- taxonomy_edge_taxonomy_term_update in ./
taxonomy_edge.module - Implements hook_taxonomy_term_update().
File
- ./
taxonomy_edge.module, line 692 - 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_build_realtime($vid) {
if (variable_get('taxonomy_edge_build_realtime', TAXONOMY_EDGE_BUILD_REALTIME)) {
$queue = queue('taxonomy_edge_items_' . $vid, TRUE);
if ($queue
->numberOfItems()) {
// Don't build realtime, if there are still items left in the queue.
return FALSE;
}
if (!lock()
->lockMayBeAvailable('taxonomy_edge_rebuild_edges_' . $vid)) {
// Don't build realtime, if entire tree rebuild is in progress.
return FALSE;
}
return TRUE;
}
return FALSE;
}