Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
QueryCache.php
Go to the documentation of this file.
1<?php
2
4
13class QueryCache extends DbCache {
14
15 public function store($tableName, $condition, $result) {
16 $key = $this->getKey ( $tableName, $condition );
17 $this->memoryCache [$key] = $result;
18 if ($this->storeDeferred) {
19 $this->toStore [] = $key;
20 } else {
21 $this->cache->store ( $key, $result );
22 }
23 }
24
25 public function delete($tableName, $condition) {
26 $key = $this->getKey ( $tableName, $condition );
27 if ($this->cache->exists ( $key )) {
28 if (isset ( $this->memoryCache [$key] )) {
29 unset ( $this->memoryCache [$key] );
30 }
31 return $this->cache->remove ( $key );
32 }
33 return false;
34 }
35}
Abstract class for database caching Ubiquity\cache\database$DbCache This class is part of Ubiquity.
Definition DbCache.php:20
getKey($tableName, $condition)
Definition DbCache.php:31
Ubiquity\cache\database$QueryCache This class is part of Ubiquity.
store($tableName, $condition, $result)
Caches the given data with the given key (tableName+md5(condition)).
Database cache systems.
Definition DbCache.php:6