You are here

delete_orphaned_terms.install in Delete Orphaned Terms 7.2

Same filename and directory in other branches
  1. 6.2 delete_orphaned_terms.install
  2. 6 delete_orphaned_terms.install

Install, update and uninstall functions for the delete_orphaned_items module.

File

delete_orphaned_terms.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the delete_orphaned_items module.
 */

/**
 * Implements hook_install().
 */
function delete_orphaned_terms_install() {
}

/**
 * Implements hook_update().
 */
function delete_orphaned_terms_update_6200() {
  $ret = array();

  // convert old values to new consistently named parameters
  $vocabs = variable_get('orphaned_terms_vocabs', FALSE);
  if ($vocabs !== FALSE) {
    variable_set('delete_orphaned_terms_vocabs', $vocabs);
    $ret[] = update_sql("DELETE FROM {variable} WHERE name='orphaned_terms_vocabs'");
  }
  $value = variable_get('orphan_value', FALSE);
  if ($value !== FALSE) {
    variable_set('delete_orphaned_terms_threshold', $value);
    $ret[] = update_sql("DELETE FROM {variable} WHERE name='orphan_value'");
  }
  return $ret;
}

/**
 * Implements hook_uninstall().
 */
function delete_orphaned_terms_uninstall() {
  db_query("DELETE FROM {variable} WHERE name LIKE 'delete_orphaned_terms_%'");
}