You are here

function patch_manager_uninstall in Patch manager 7

Same name and namespace in other branches
  1. 6 patch_manager.install \patch_manager_uninstall()

Implements hook_uninstall().

@todo Review the conversion of the statement to the D7 database API syntax.

File

./patch_manager.install, line 28
Install, update and uninstall functions for the Patch manager module.

Code

function patch_manager_uninstall() {

  // Delete instances for each defined field.
  $instances = field_info_instances('node', 'patch');
  foreach ($instances as $instance) {
    field_delete_instance($instance);
  }

  // Uninstall our fields.
  $fields = patch_manager_field_info();
  foreach ($fields as $field) {
    field_delete_field($field['field_name']);
  }

  // Remove any actions we created.
  // TODO Please review the conversion of this statement to the D7 database API
  // syntax, add LIMIT 10.

  /* db_query('DELETE FROM {actions} WHERE aid LIKE "patch_manager_%" LIMIT 10') */
  db_delete('actions')
    ->condition('aid', "patch_manager_%", 'LIKE')
    ->execute();
}