You are here

public function purl_cache::get in Persistent URL 6

Same name and namespace in other branches
  1. 7 purl.module \purl_cache::get()

Parameters

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

$id: Optional key of the required info.

Return value

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

File

./purl.module, line 840

Class

purl_cache
Specialized cache for storing modifier 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 isset($this->cache[$method]) ? $this->cache[$method] : array();
  }
  else {
    return $this->cache;
  }
}