You are here

function variable_realm in Variable 7

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

Get variable realm controller.

The first time this function is invoked we initialize the realm system and store global variables in the global/default realm.

Parameters

$realm: Name of the realm to get / create.

$key: Realm key to get / create

Return value

VariableRealmControllerInterface

3 calls to variable_realm()
variable_realm_add in variable_realm/variable_realm.module
Set values for variable realm
variable_realm_edit_variables_form in variable_realm/variable_realm.form.inc
Edit variables for realm.
variable_realm_status in variable_realm/variable_realm.module
Set / get current realm values.
7 string references to 'variable_realm'
VariableStoreTestCase::setUp in variable_store/variable_store.test
Sets up a Drupal site for running functional and integration tests.
variable_realm_admin_menu in variable_realm_admin/variable_realm_admin.module
Implements hook_menu().
variable_realm_admin_realm_edit in variable_realm_admin/variable_realm_admin.pages.inc
Edit variables for realm.
variable_realm_features_api in variable_realm/variable_realm.module
Implements hook_features_api().
variable_realm_features_export in variable_realm/variable_realm.features.inc
Implements hook_features_export().

... See full list

File

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

Code

function variable_realm($realm, $key) {
  static $drupal_static_fast;
  if (!isset($drupal_static_fast)) {
    $drupal_static_fast['realm'] =& drupal_static(__FUNCTION__);
    $drupal_static_fast['realm']['global']['default'] = _variable_realm_controller('global', 'default', $GLOBALS['conf']);
  }
  $variable_realm =& $drupal_static_fast['realm'];
  if (!isset($variable_realm[$realm][$key])) {
    $variable_realm[$realm][$key] = _variable_realm_controller($realm, $key);
  }
  return $variable_realm[$realm][$key];
}