| @@ 1100-1114 (lines=15) @@ | ||
| 1097 | $db = self::getInstance(); |
|
| 1098 | } |
|
| 1099 | ||
| 1100 | if ($useCache === true) { |
|
| 1101 | $cache = new Cache(null, null, false, $useCache); |
|
| 1102 | $cacheKey = 'sql-' . \md5($query); |
|
| 1103 | ||
| 1104 | if ( |
|
| 1105 | $cache->getCacheIsReady() === true |
|
| 1106 | && |
|
| 1107 | $cache->existsItem($cacheKey) |
|
| 1108 | ) { |
|
| 1109 | return $cache->getItem($cacheKey); |
|
| 1110 | } |
|
| 1111 | } else { |
|
| 1112 | $cache = false; |
|
| 1113 | } |
|
| 1114 | ||
| 1115 | $result = $db->query($query); |
|
| 1116 | ||
| 1117 | if ($result instanceof Result) { |
|
| @@ 194-208 (lines=15) @@ | ||
| 191 | ' . $whereSQL . ' |
|
| 192 | '; |
|
| 193 | ||
| 194 | if ($useCache === true) { |
|
| 195 | $cache = new Cache(null, null, false, $useCache); |
|
| 196 | $cacheKey = 'sql-phonetic-search-' . \md5($query); |
|
| 197 | ||
| 198 | if ( |
|
| 199 | $cache->getCacheIsReady() === true |
|
| 200 | && |
|
| 201 | $cache->existsItem($cacheKey) |
|
| 202 | ) { |
|
| 203 | return $cache->getItem($cacheKey); |
|
| 204 | } |
|
| 205 | } else { |
|
| 206 | $cache = false; |
|
| 207 | } |
|
| 208 | ||
| 209 | $result = $dbConnection->query($query); |
|
| 210 | ||
| 211 | // make sure the row exists |
|