You are here

private function OgVariableStoreRealmStore::getAllKeys in OG Variables 7

Get all the keys that should fetch for set key.

1 call to OgVariableStoreRealmStore::getAllKeys()
OgVariableStoreRealmStore::variable_init in ./og_variables.class.inc
Initialize realm.

File

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

Class

OgVariableStoreRealmStore
@file Variable realm controller

Code

private function getAllKeys() {
  $keys = array(
    $this->key,
  );
  if (module_exists('og_subgroups')) {
    list(, $nid) = explode('_', $this->key);

    // We fetch one level at time to perserve hierarchy.
    $parents = og_subgroups_parents_load('node', $nid, TRUE, FALSE);
    while (!empty($parents['node'])) {
      $parent = reset($parents['node']);
      $keys[] = 'node_' . $parent;

      // og_subgroups_parents_load is cached well.
      $parents = og_subgroups_parents_load('node', $parent, TRUE, FALSE);
    }
  }
  return $keys;
}