You are here

function invite_by_email_uninstall in Invite 7.4

Implements hook_uninstall().

File

modules/invite_by_email/invite_by_email.install, line 66
Install, update and uninstall functions for the Invite by e-mail.

Code

function invite_by_email_uninstall() {
  if (function_exists('invite_type_load')) {
    $invite_type = invite_type_load('invite_by_email');
    invite_type_delete($invite_type);
  }
  db_delete('invite_sending_controller')
    ->condition('name', 'invite_by_email')
    ->execute();
  $fields = array(
    'field_invitation_email_address',
    'field_invitation_email_subject',
    'field_invitation_email_body',
  );
  foreach ($fields as $field) {
    field_delete_field($field);
  }
  db_delete('field_config_instance')
    ->condition('bundle', 'invite_by_email')
    ->execute();
  drupal_cron_run();
}