src/Mouf/Database/TDBM/QueryFactory/FindObjectsFromSqlQueryFactory.php 1 location
|
@@ 172-181 (lines=10) @@
|
| 169 |
|
* |
| 170 |
|
* @return mixed |
| 171 |
|
*/ |
| 172 |
|
protected function fromCache(string $key, callable $closure) |
| 173 |
|
{ |
| 174 |
|
$item = $this->cache->fetch($key); |
| 175 |
|
if ($item === false) { |
| 176 |
|
$item = $closure(); |
| 177 |
|
$this->cache->save($key, $item); |
| 178 |
|
} |
| 179 |
|
|
| 180 |
|
return $item; |
| 181 |
|
} |
| 182 |
|
} |
| 183 |
|
|
src/Mouf/Database/TDBM/TDBMService.php 1 location
|
@@ 1392-1401 (lines=10) @@
|
| 1389 |
|
* |
| 1390 |
|
* @return mixed |
| 1391 |
|
*/ |
| 1392 |
|
private function fromCache(string $key, callable $closure) |
| 1393 |
|
{ |
| 1394 |
|
$item = $this->cache->fetch($key); |
| 1395 |
|
if ($item === false) { |
| 1396 |
|
$item = $closure(); |
| 1397 |
|
$this->cache->save($key, $item); |
| 1398 |
|
} |
| 1399 |
|
|
| 1400 |
|
return $item; |
| 1401 |
|
} |
| 1402 |
|
|
| 1403 |
|
/** |
| 1404 |
|
* Returns the foreign key object. |