You are here

function merci_taxonomy_node_delete_vocabulary in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.2

Same name and namespace in other branches
  1. 6.2 includes/database.inc \merci_taxonomy_node_delete_vocabulary()

@todo Please document this function.

See also

http://drupal.org/node/1354

1 call to merci_taxonomy_node_delete_vocabulary()
merci_taxonomy_json in includes/menu.inc
@todo Please document this function.

File

includes/database.inc, line 45
MERCI - Managed Equipment Reservation Checkout and Inventory

Code

function merci_taxonomy_node_delete_vocabulary($node, $vid) {
  if (empty($vid) or empty($node->vid)) {
    return;
  }

  // TODO Please review the conversion of this statement to the D7 database API syntax.

  /* db_query("DELETE FROM {taxonomy_term_node} WHERE vid = %d and tid IN (SELECT tid FROM {taxonomy_term_data} td WHERE td.vid = %d)", $node->vid, $vid) */
  db_delete('taxonomy_term_node')
    ->where('vid = %d and tid IN (SELECT tid FROM {taxonomy_term_data} td WHERE td.vid = %d)', $node->vid, $vid)
    ->execute();
}