class AcquiaLiftReportCache in Acquia Lift Connector 7
Same name and namespace in other branches
- 7.2 includes/AcquiaLiftReportCache.inc \AcquiaLiftReportCache
Class AcquiaLiftReportCache
An OOP wrapper around cache_get() and cache_set().
Hierarchy
- class \AcquiaLiftReportCache implements AcquiaLiftReportCacheInterface
Expanded class hierarchy of AcquiaLiftReportCache
File
- includes/
acquia_lift.classes.inc, line 1683 - Provides an agent type for Acquia Lift
View source
class AcquiaLiftReportCache implements AcquiaLiftReportCacheInterface {
/**
* Holds the reports retrieved from the cache.
*
* @var array
*/
protected $cache = array();
/**
* The cache bin to use.
*
* @var string
*/
protected $bin = 'cache_acquia_lift_reports';
/**
* Implements AcquiaLiftReportCacheInterface::getCachedReports().
*/
public function getCachedReports($agent_name) {
if (!isset($this->cache[$agent_name])) {
if ($get = cache_get($agent_name, $this->bin)) {
$this->cache[$agent_name] = $get->data;
}
else {
$this->cache[$agent_name] = FALSE;
}
}
return $this->cache[$agent_name];
}
/**
* Implements AcquiaLiftReportCacheInterface::cacheReports().
*/
public function cacheReports($agent_name, $data) {
cache_set($agent_name, $data, $this->bin);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AcquiaLiftReportCache:: |
protected | property | The cache bin to use. | |
AcquiaLiftReportCache:: |
protected | property | Holds the reports retrieved from the cache. | |
AcquiaLiftReportCache:: |
public | function |
Implements AcquiaLiftReportCacheInterface::cacheReports(). Overrides AcquiaLiftReportCacheInterface:: |
|
AcquiaLiftReportCache:: |
public | function |
Implements AcquiaLiftReportCacheInterface::getCachedReports(). Overrides AcquiaLiftReportCacheInterface:: |