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

QueryCache::fetch()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 2
eloc 5
nc 2
nop 2
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