You are here

function _taxonomy_edge_taxonomy_term_update in Taxonomy Edge 7

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

Update a term in the edge tree.

Parameters

object $term: Term object.

3 calls to _taxonomy_edge_taxonomy_term_update()
taxonomy_edge_process_queue_item in ./taxonomy_edge.module
Cron queue worker.
taxonomy_edge_reorder_submit in ./taxonomy_edge.module
Copy/paste from core taxonomy module.
taxonomy_edge_taxonomy_term_update in ./taxonomy_edge.module
Implements hook_taxonomy_term_update().

File

./taxonomy_edge.module, line 587
Optimization of taxonomy data model for SQL performance.

Code

function _taxonomy_edge_taxonomy_term_update($term) {
  $tx = db_transaction();

  // Invalidate sorted tree in case of name/weight change.
  $modified =& drupal_static('taxonomy_edge_save_check_modified', TRUE);
  if ($modified) {
    taxonomy_edge_invalidate_order($term->vid);
  }
  if (!isset($term->parent)) {

    // Parent not set, no need to update hierarchy.
    return;
  }

  // Derive proper parents.
  $parents = _taxonomy_edge_unify_parents($term->parent);
  _taxonomy_edge_move_subtree($term->vid, $term->tid, $parents);
}