19 public function store($tableName, $condition, $result) {
20 $exists = $this->
getCache ( $tableName );
21 $exists [$this->
getKey ( $condition )] = $result;
22 $this->cache->store ( $tableName,
"return " .
UArray::asPhpArray ( $exists,
"array" ) .
";" );
26 if ($this->cache->exists ( $tableName ))
27 return $this->cache->fetch ( $tableName );
32 if (isset ( $this->arrayCache [$tableName] ))
33 return $this->arrayCache [$tableName];
34 if ($this->cache->exists ( $tableName )) {
35 return $this->arrayCache [$tableName] = $this->cache->fetch ( $tableName );
40 public function fetch($tableName, $condition) {
42 $key = $this->
getKey ( $condition );
43 if (isset (
$cache [$key] ))
49 public function delete($tableName, $condition) {
51 $key = $this->
getKey ( $condition );
52 if (isset (
$cache [$key] )) {
store($tableName, $condition, $result)
Abstract class for database caching Ubiquity$DbCache This class is part of Ubiquity.
getArrayCache($tableName)
fetch($tableName, $condition)
Cache Ubiquity$TableCache This class is part of Ubiquity.
static asPhpArray($array, $prefix="", $depth=1, $format=false)