Ubiquity  2.0.3
php rapid development framework
QueryCache.php
Go to the documentation of this file.
1 <?php
2 
4 
7 
8 class QueryCache extends DbCache {
9 
10  public function fetch($tableName, $condition) {
11  $key=$tableName . "." . $this->getKey($condition);
12  if ($this->cache->exists($key))
13  return $this->cache->fetch($key);
14  return false;
15  }
16 
17  public function store($tableName, $condition, $result) {
18  $this->cache->store($tableName . "." . $this->getKey($condition), "return " . UArray::asPhpArray($result, "array") . ";");
19  }
20 
21  public function delete($tableName, $condition){
22  $key=$tableName . "." . $this->getKey($condition);
23  if ($this->cache->exists($key))
24  return $this->cache->remove($key);
25  return false;
26  }
27 }
fetch($tableName, $condition)
Definition: QueryCache.php:10
store($tableName, $condition, $result)
Definition: QueryCache.php:17
static asPhpArray($array, $prefix="", $depth=1, $format=false)
Definition: UArray.php:53