You are here

function taxonomy_edge_taxonomy in Taxonomy Edge 6

Implementation of hook_taxonomy().

Maintain edges upon taxonomy manipulation

File

./taxonomy_edge.module, line 232
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($op, $type, $array = NULL) {
  switch ($type) {
    case 'term':
      $term = (object) $array;
      switch ($op) {
        case 'insert':
          taxonomy_edge_taxonomy_term_insert($term);
          break;
        case 'update':
          taxonomy_edge_taxonomy_term_update($term);
          break;
        case 'delete':
          taxonomy_edge_taxonomy_term_delete($term);
          break;
      }
      break;
    case 'vocabulary':
      $vocabulary = (object) $array;
      switch ($op) {
        case 'insert':
          taxonomy_edge_taxonomy_vocabulary_insert($vocabulary);
          break;
        case 'delete':
          taxonomy_edge_taxonomy_vocabulary_delete($vocabulary);
          break;
      }
      break;
  }
}