|
14 | 14 | use Doctrine\DBAL\Connection;
|
15 | 15 | use Doctrine\DBAL\DBALException;
|
16 | 16 | use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
|
| 17 | +use Doctrine\DBAL\Result; |
17 | 18 | use Doctrine\DBAL\Schema\Schema;
|
18 | 19 | use Symfony\Component\Cache\Exception\InvalidArgumentException;
|
19 | 20 |
|
@@ -175,15 +176,16 @@ protected function doFetch(array $ids)
|
175 | 176 | foreach ($ids as $id) {
|
176 | 177 | $stmt->bindValue(++$i, $id);
|
177 | 178 | }
|
178 |
| - $stmt->execute(); |
| 179 | + $result = $stmt->execute(); |
179 | 180 |
|
180 |
| - if (method_exists($stmt, 'iterateNumeric')) { |
181 |
| - $stmt = $stmt->iterateNumeric(); |
| 181 | + if ($result instanceof Result) { |
| 182 | + $result = $result->iterateNumeric(); |
182 | 183 | } else {
|
183 | 184 | $stmt->setFetchMode(\PDO::FETCH_NUM);
|
| 185 | + $result = $stmt; |
184 | 186 | }
|
185 | 187 |
|
186 |
| - foreach ($stmt as $row) { |
| 188 | + foreach ($result as $row) { |
187 | 189 | if (null === $row[1]) {
|
188 | 190 | $expired[] = $row[0];
|
189 | 191 | } else {
|
@@ -213,9 +215,9 @@ protected function doHave($id)
|
213 | 215 |
|
214 | 216 | $stmt->bindValue(':id', $id);
|
215 | 217 | $stmt->bindValue(':time', time(), \PDO::PARAM_INT);
|
216 |
| - $stmt->execute(); |
| 218 | + $result = $stmt->execute(); |
217 | 219 |
|
218 |
| - return (bool) $stmt->fetchColumn(); |
| 220 | + return (bool) ($result instanceof Result ? $result->fetchOne() : $stmt->fetchColumn()); |
219 | 221 | }
|
220 | 222 |
|
221 | 223 | /**
|
|
0 commit comments