You are here

public function context_prefix_cache::get in Context 5

Parameters

$method: The method to retrieve from the cache for.

$item: Optionally and key of the required info.

Return value

the desired info or false if an id doesn't exist.

File

context_prefix/context_prefix.module, line 867

Class

context_prefix_cache
Specialized cache for storing prefix information.

Code

public function get($method = false, $id = false) {
  if ($method !== false && $id !== false) {
    return isset($this->cache[$method][$id]) ? $this->cache[$method][$id] : false;
  }
  elseif ($method !== false) {
    return $this->cache[$method];
  }
  else {
    return $this->cache;
  }
}