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

QueryCache   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 3
dl 0
loc 13
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fetch() 0 6 2
A store() 0 3 1
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