You are here

function _taxonomy_edge_taxonomy_term_queue in Taxonomy Edge 8

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

Queue an operation for the edge tree.

Parameters

object $term: Term object

string $op: insert, update or delete

3 calls to _taxonomy_edge_taxonomy_term_queue()
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 603
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_taxonomy_term_queue($term, $op) {

  // Wait for rebuild to clear queue and initiate snapshot of term_hierarchy
  if (lock()
    ->lockMayBeAvailable('taxonomy_edge_rebuild_edges_' . $term->vid)) {
    $queue = DrupalQueue::get('taxonomy_edge_items_' . $term->vid, TRUE);
    $term->operation = $op;
    $queue
      ->createItem($term);
    $queue = DrupalQueue::get('taxonomy_edge', TRUE);
    $queue
      ->createItem($term->vid);
  }
}