Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
MemoryCache.php
Go to the documentation of this file.
1<?php
2
4
13class MemoryCache extends DbCache {
18 protected $memoryCache;
19
20 public function __construct() {
21 }
22
23 public function fetch($tableName, $condition) {
24 $key = $this->getKey ( $tableName, $condition );
25 if (isset ( $this->memoryCache [$key] )) {
26 return $this->memoryCache [$key];
27 }
28 return false;
29 }
30
31 public function store($tableName, $condition, $result) {
32 $this->memoryCache [$this->getKey ( $tableName, $condition )] = $result;
33 }
34
35 public function delete($tableName, $condition) {
36 $key = $this->getKey ( $tableName, $condition );
37 if (isset ( $this->memoryCache [$key] )) {
38 unset ( $this->memoryCache [$key] );
39 return true;
40 }
41 return false;
42 }
43}
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$MemoryCache This class is part of Ubiquity.
fetch($tableName, $condition)
Fetches data stored for the given condition in table.
store($tableName, $condition, $result)
Caches the given data with the given key (tableName+md5(condition)).
Database cache systems.
Definition DbCache.php:6