You are here

function paypal_donations_uninstall in PayPal Donations 7

Implements hook_uninstall().

File

./paypal_donations.install, line 186
Sets up the base table for our entity and a table to store information about the entity types.

Code

function paypal_donations_uninstall() {
  $fields_to_be_deleted = array(
    'field_paypal_transaction_id',
    'field_paypal_donator_email',
    'field_paypal_donations_amount',
    'field_paypal_donator_name',
    'field_paypal_donator_country',
    'field_paypal_donations_type',
  );
  foreach ($fields_to_be_deleted as $field) {
    $instance = array(
      'field_name' => $field,
      'entity_type' => 'paypal_donations_item',
      'bundle' => 'paypal_donations_item',
    );
    field_delete_instance($instance);
  }
  require_once drupal_get_path("module", "paypal_donations") . "/includes/paypal_donations.variable.inc";
  $variables = array_keys(paypal_donations_variable_info(array()));
  foreach ($variables as $var) {
    variable_del($var);
  }
}