You are here

public function OgVariableStoreRealmStore::variable_init in OG Variables 7

Initialize realm.

Overrides VariableStoreRealmStore::variable_init

2 calls to OgVariableStoreRealmStore::variable_init()
OgVariableStoreRealmStore::variable_get in ./og_variables.class.inc
Default to global to get around form fields default to hard default.
OgVariableStoreRealmStore::variable_list in ./og_variables.class.inc
List all current variable values.

File

./og_variables.class.inc, line 99
Variable Realm controller.

Class

OgVariableStoreRealmStore
@file Variable realm controller

Code

public function variable_init() {
  if (!isset($this->variables)) {

    // We need to traverse the key to get parent ones also.
    $keys = $this
      ->getAllKeys();

    // We need to keep this by reference so changes are reflected.
    $this->variables =& variable_store($this->realm, array_shift($keys));
    $this->parent_variables = array();
    foreach ($keys as $key) {

      // variable_store is cached so likely fetching cached info.
      $this->parent_variables += variable_store($this->realm, $key);
    }
  }
}