src/Mouf/Database/TDBM/QueryFactory/FindObjectsFromSqlQueryFactory.php 1 location
|
@@ 195-204 (lines=10) @@
|
192 |
|
* |
193 |
|
* @return mixed |
194 |
|
*/ |
195 |
|
protected function fromCache(string $key, callable $closure) |
196 |
|
{ |
197 |
|
$item = $this->cache->fetch($key); |
198 |
|
if ($item === false) { |
199 |
|
$item = $closure(); |
200 |
|
$this->cache->save($key, $item); |
201 |
|
} |
202 |
|
|
203 |
|
return $item; |
204 |
|
} |
205 |
|
} |
206 |
|
|
src/Mouf/Database/TDBM/TDBMService.php 1 location
|
@@ 1371-1380 (lines=10) @@
|
1368 |
|
* |
1369 |
|
* @return mixed |
1370 |
|
*/ |
1371 |
|
private function fromCache(string $key, callable $closure) |
1372 |
|
{ |
1373 |
|
$item = $this->cache->fetch($key); |
1374 |
|
if ($item === false) { |
1375 |
|
$item = $closure(); |
1376 |
|
$this->cache->save($key, $item); |
1377 |
|
} |
1378 |
|
|
1379 |
|
return $item; |
1380 |
|
} |
1381 |
|
|
1382 |
|
/** |
1383 |
|
* Returns the foreign key object. |