You are here

function profile2_uninstall in Profile 2 7

Same name and namespace in other branches
  1. 7.2 profile2.install \profile2_uninstall()

Implements hook_uninstall()

File

./profile2.install, line 152
Install, update and uninstall functions for the profile module.

Code

function profile2_uninstall() {

  // Select all available profile2 bundles from the database directly, instead
  // of entity_load() call. See https://drupal.org/node/1330598 for details.
  $types = db_select('profile_type', 'p')
    ->fields('p')
    ->execute()
    ->fetchAllAssoc('type');
  foreach ($types as $name => $type) {
    field_attach_delete_bundle('profile2', $name);
  }
}