You are here

function pmpapi_push_uninstall in Public Media Platform API Integration 7

Implements hook_uninstall().

File

pmpapi_push/pmpapi_push.install, line 18
Install, update and uninstall functions for the PMPAPI Push module.

Code

function pmpapi_push_uninstall() {
  module_load_include('module', 'pmpapi_push');
  module_load_include('module', 'pmpapi');
  variable_del('pmpapi_push_push_active');
  foreach (pmpapi_push_get_entities() as $entity_type => $entity) {
    $bundles = $entity['bundles'];
    if ($bundles) {
      foreach ($bundles as $bundle_name => $bundle) {
        $uname = $entity_type . '__' . $bundle_name;
        variable_del('pmpapi_push_' . $uname . '_profile');
        foreach (pmpapi_get_profile_list() as $profile) {
          variable_del('pmpapi_push_mapping_' . $uname . '_' . $profile);
        }
      }
    }
  }
}