Completed
Push — master ( 25576f...77f108 )
by Jean-Christophe
02:06
created

QueryCache::store()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 3
1
<?php
2
namespace micro\cache\database;
3
4
use micro\cache\database\DbCache;
5
use micro\utils\JArray;
6
7
class QueryCache extends DbCache {
8
9
	public function fetch($tableName, $condition) {
10
		$key=$tableName.".".$this->getKey($condition);
11
		if($this->cache->exists($key))
12
			return $this->cache->fetch($key);
13
		return false;
14
	}
15
16
	public function store($tableName, $condition, $result) {
17
		$this->cache->store($tableName.".".$this->getKey($condition),"return ".JArray::asPhpArray($result,"array").";");
18
	}
19
}
20