You are here

function variable_realm_set in Variable 7.2

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

Set value for realm variable.

5 calls to variable_realm_set()
drush_variable_realm_set in variable_realm/variable_realm.drush.inc
Drush command callback. Set realm's variables.
variable_realm_edit_variables_form_submit in variable_realm/variable_realm.form.inc
Edit variables for realm.
variable_realm_global_set in variable_realm/variable_realm.module
Switch global variable
variable_realm_variable_settings_form_submit in variable_realm/variable_realm.form.inc
Save realm variables and remove them from form.
variable_realm_variable_theme_form_submit in variable_realm/variable_realm.form.inc
Process system_theme_settings form submissions.

File

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

Code

function variable_realm_set($realm, $key, $name, $value, $rebuild = TRUE) {
  if ($store = variable_realm($realm, $key)) {
    $old_value = variable_realm_get($realm, $key, $name);
    $store
      ->variable_set($name, $value);
    if ($rebuild) {
      variable_realm_refresh($realm, $key, $name);
    }
    $options = array(
      'realm' => $store->realm,
      'key' => $store->key,
    );
    module_invoke_all('variable_update', $name, $value, $old_value, $options);
  }
}