class ECKCache in Entity Construction Kit (ECK) 7.3
Same name and namespace in other branches
- 7.2 eck.classes.inc \ECKCache
Hierarchy
- class \ECKCache
Expanded class hierarchy of ECKCache
File
- ./
eck.classes.inc, line 888 - Classes for all the different objects used in ECK.
View source
class ECKCache {
private $id;
private $data;
private $noCache;
/**
* Constructor.
*/
public function __construct($id) {
$this->id = $id;
$this->noCache = FALSE;
if (!db_table_exists('cache_eck')) {
$this->noCache = TRUE;
}
}
/**
* Set.
*/
public function set($data) {
if ($this->noCache) {
return;
}
cache_set($this->id, $data, "cache_eck");
$this->data = $data;
}
/**
* Get.
*/
public function get() {
if ($this->noCache) {
return NULL;
}
if ($this->data) {
return $this->data;
}
else {
$cached_data = cache_get($this->id, "cache_eck");
if ($cached_data) {
$this->data = $cached_data->data;
return $this->data;
}
else {
return NULL;
}
}
}
/**
* Reset.
*/
public function reset() {
if ($this->noCache) {
return;
}
$this->data = NULL;
cache_clear_all($this->id, 'cache_eck');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ECKCache:: |
private | property | ||
ECKCache:: |
private | property | ||
ECKCache:: |
private | property | ||
ECKCache:: |
public | function | Get. | |
ECKCache:: |
public | function | Reset. | |
ECKCache:: |
public | function | Set. | |
ECKCache:: |
public | function | Constructor. |