You are here

function context_cache_get in Context 6.2

Same name and namespace in other branches
  1. 6.3 context.module \context_cache_get()
  2. 6 context.module \context_cache_get()
  3. 7.3 context.module \context_cache_get()

Wrapper around cache_get() to make it easier for context to pull different datastores from a single cache row.

4 calls to context_cache_get()
context_conditions in ./context.module
Invokes hook_context_conditions() to provide an array of conditions that may be associated with a context.
context_condition_map in ./context.module
Loads an associative array of conditions => context identifiers to allow contexts to be set by different conditions. Called by context_set_by_condition().
context_enabled_contexts in ./context.module
Retrieves all enabled contexts from the cache.
context_reactions in ./context.module
Invokes hook_context_reactions() to provide an array of reactions that may be associated with a context.

File

./context.module, line 378

Code

function context_cache_get($key, $reset = FALSE) {
  static $cache;
  if (!isset($cache) || $reset) {
    $cache = cache_get('context', 'cache');
    $cache = $cache ? $cache->data : array();
  }
  return !empty($cache[$key]) ? $cache[$key] : FALSE;
}