|
@@ 299-303 (lines=5) @@
|
| 296 |
|
public function rawCached(string $sql, string $index = null, bool $assoc = true, int $ttl = null){ |
| 297 |
|
$result = $this->cacheGet($sql, [], $index); |
| 298 |
|
|
| 299 |
|
if(!$result){ |
| 300 |
|
$result = $this->raw($sql, $index, $assoc); |
| 301 |
|
|
| 302 |
|
$this->cacheSet($sql, [], $index, $result, $ttl); |
| 303 |
|
} |
| 304 |
|
|
| 305 |
|
return $result; |
| 306 |
|
} |
|
@@ 320-324 (lines=5) @@
|
| 317 |
|
public function preparedCached(string $sql, array $values = [], string $index = null, bool $assoc = true, int $ttl = null){ |
| 318 |
|
$result = $this->cacheGet($sql, $values, $index); |
| 319 |
|
|
| 320 |
|
if(!$result){ |
| 321 |
|
$result = $this->prepared($sql, $values, $index, $assoc); |
| 322 |
|
|
| 323 |
|
$this->cacheSet($sql, $values, $index, $result, $ttl); |
| 324 |
|
} |
| 325 |
|
|
| 326 |
|
return $result; |
| 327 |
|
} |