Skip to content

Commit 917ec50

Browse files
Update fetch methods for usage with newer doctrine dbal
1 parent 2c2dfd7 commit 917ec50

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

EventSubscriber/LogHistorySubscriber.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ private function getRevisionId(ClassMetadata $class, $entityData, $revType) {
242242
$result = $this->conn->executeQuery($sql);
243243

244244
if ($result->rowCount() == 1) {
245-
return $result->fetch()[$this->config->getRevisionFieldName()] + 1;
245+
return $result->fetchAssociative()[$this->config->getRevisionFieldName()] + 1;
246246
} elseif ($result->rowCount() > 1) {
247247
throw new \LogicException('Error while selecting new rev number');
248248
} else {

Reader/HistoryReader.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function findRevisions($className, $id) {
6767
$query = 'SELECT * FROM ' . $tableName . ' h WHERE h.id = ?';
6868

6969
// Execute query
70-
$revisions = $this->em->getConnection()->fetchAll($query, $id);
70+
$revisions = $this->em->getConnection()->fetchAllAssociative($query, $id);
7171

7272
// Create history revisions
7373
return $this->createHistoryCollection($className, $revisions);
@@ -93,7 +93,7 @@ public function findRevision($className, $id, $revision) {
9393
$query = 'SELECT * FROM ' . $tableName . ' h WHERE h.id = ? AND h.rev = ?';
9494

9595
// Execute query
96-
$revisions = $this->em->getConnection()->fetchAll($query, array($id, $revision));
96+
$revisions = $this->em->getConnection()->fetchAllAssociative($query, array($id, $revision));
9797

9898
// Create history revisions
9999
$history = $this->createHistoryCollection($className, $revisions);
@@ -143,7 +143,7 @@ public function findRevisionsByCriteria($className, array $criteria) {
143143
$query = 'SELECT * FROM ' . $tableName . ' h WHERE ' . $whereSql . " ORDER BY h.id DESC";
144144

145145
// Execute query
146-
$revisions = $this->em->getConnection()->fetchAll($query, array_values($criteria));
146+
$revisions = $this->em->getConnection()->fetchAllAssociative($query, array_values($criteria));
147147

148148
// Create history revisions
149149
return $this->createHistoryCollection($className, $revisions);

0 commit comments

Comments
 (0)