Skip to content

Commit

Permalink
[BUGFIX] Only call fetchAllAssociative if its available
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkott committed Jun 21, 2023
1 parent 2d07898 commit d43358b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Classes/Updates/AbstractUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,16 @@ protected function getRecordsByCriteria(QueryBuilder $queryBuilder, array $crite
$result = $queryBuilder->executeQuery();
} else {
/** @var Result $result */
/** @phpstan-ignore-next-line */
$result = $queryBuilder->execute();
}

return $result->fetchAllAssociative();
/** @phpstan-ignore-next-line */
if (method_exists($result, 'fetchAllAssociative')) {
return $result->fetchAllAssociative(); /** @phpstan-ignore-line */
}

return $result->fetchAll(\PDO::FETCH_ASSOC); /** @phpstan-ignore-line */
}

protected function updateRecord(int $uid, array $values): void
Expand Down

0 comments on commit d43358b

Please sign in to comment.