class crumbs_TrailCache in Crumbs, the Breadcrumbs suite 7.2
Class crumbs_Container_LazyTrails
Hierarchy
- class \crumbs_TrailCache
Expanded class hierarchy of crumbs_TrailCache
File
- lib/
TrailCache.php, line 6
View source
class crumbs_TrailCache {
/**
* @var array
* Cached data
*/
protected $data = array();
/**
* @var crumbs_TrailFinder
*/
protected $source;
/**
* @todo Add an interface for $source.
* Don't restrict it to crumbs_TrailFinder.
*
* @param crumbs_TrailFinder $source
*/
function __construct($source) {
$this->source = $source;
}
/**
* @param $path
* @return mixed
*/
function getForPath($path) {
if (!isset($this->data[$path])) {
$this->data[$path] = $this->source
->getForPath($path);
}
return $this->data[$path];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
crumbs_TrailCache:: |
protected | property | Cached data | |
crumbs_TrailCache:: |
protected | property | ||
crumbs_TrailCache:: |
function | |||
crumbs_TrailCache:: |
function | @todo Add an interface for $source. Don't restrict it to crumbs_TrailFinder. |