You are here

pmpapi_push.install in Public Media Platform API Integration 7

Install, update and uninstall functions for the PMPAPI Push module.

File

pmpapi_push/pmpapi_push.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the PMPAPI Push module.
 */

/**
 * Implements hook_install().
 */
function pmpapi_push_install() {
  variable_set('pmpapi_push_push_active', TRUE);
}

/**
 * Implements hook_uninstall().
 */
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);
        }
      }
    }
  }
}

Functions