You are here

function variable_realm_variable_delete in Variable 7.2

Same name and namespace in other branches
  1. 7 variable_realm/variable_realm.module \variable_realm_variable_delete()

Implements hook_variable_delete().

File

variable_realm/variable_realm.module, line 457
Variable API module - Realms

Code

function variable_realm_variable_delete($variable, $options) {

  // If there's a realm option, we are already deleting variable for a realm only.
  if (empty($options['realm'])) {

    // Delete each variable for each current and existing realm/key
    foreach (variable_children($variable['name']) as $variable_name) {
      foreach (variable_realm_list_all() as $realm_controller) {
        $realm_controller
          ->deleteVariable($variable_name);
      }
    }
    variable_realm_rebuild();
  }
}