| Total Complexity | 6 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 53.33% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class MemoryCache extends DbCache { |
||
| 14 | /** |
||
| 15 | * |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | protected $memoryCache; |
||
| 19 | |||
| 20 | 9 | public function __construct() { |
|
| 21 | 9 | } |
|
| 22 | |||
| 23 | 9 | public function fetch($tableName, $condition) { |
|
| 24 | 9 | $key = $this->getKey ( $tableName, $condition ); |
|
| 25 | 9 | if (isset ( $this->memoryCache [$key] )) { |
|
| 26 | return $this->memoryCache [$key]; |
||
| 27 | } |
||
| 28 | 9 | return false; |
|
| 29 | } |
||
| 30 | |||
| 31 | 9 | public function store($tableName, $condition, $result) { |
|
| 32 | 9 | $this->memoryCache [$this->getKey ( $tableName, $condition )] = $result; |
|
| 33 | } |
||
| 34 | |||
| 35 | public function delete($tableName, $condition) { |
||
| 42 | } |
||
| 43 | } |
||
| 44 |