You are here

function _taxonomy_edge_taxonomy_term_delete in Taxonomy Edge 7.2

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

Delete a term from the edge tree.

Parameters

$tid: Term ID.

2 calls to _taxonomy_edge_taxonomy_term_delete()
taxonomy_edge_process_queue_item in ./taxonomy_edge.module
Cron queue worker Process edge for a queued term.
taxonomy_edge_taxonomy_term_delete in ./taxonomy_edge.module
Implements hook_taxonomy_term_delete().

File

./taxonomy_edge.module, line 644
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_delete($term) {
  db_query("DELETE FROM {taxonomy_term_edge} WHERE pid IN (SELECT p.pid FROM {taxonomy_term_edge_path} p WHERE p.tid = :tid)", array(
    ':tid' => $term->tid,
  ));
  db_query("DELETE FROM {taxonomy_term_edge} WHERE parent IN (SELECT p.pid FROM {taxonomy_term_edge_path} p WHERE p.tid = :tid)", array(
    ':tid' => $term->tid,
  ));
  db_query("DELETE FROM {taxonomy_term_edge_path} WHERE tid = :tid", array(
    ':tid' => $term->tid,
  ));
}