diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-03-18 08:28:06 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-03-18 15:40:18 +0100 |
commit | 0d8b3baf61a87042e32e42325aae4f27252f0bd2 (patch) | |
tree | 2db143c95e65353663dd43784d6e32905aef8e96 /lib | |
parent | b34035f845bffc5be044dd157d1675875e451cad (diff) | |
download | nextcloud-server-0d8b3baf61a87042e32e42325aae4f27252f0bd2.tar.gz nextcloud-server-0d8b3baf61a87042e32e42325aae4f27252f0bd2.zip |
Use executeQuery and executeUpdate in the QBMapper
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/public/AppFramework/Db/QBMapper.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php index 8c324d9c601..3fc7942c0dd 100644 --- a/lib/public/AppFramework/Db/QBMapper.php +++ b/lib/public/AppFramework/Db/QBMapper.php @@ -101,7 +101,7 @@ abstract class QBMapper { ->where( $qb->expr()->eq('id', $qb->createNamedParameter($entity->getId(), $idType)) ); - $qb->execute(); + $qb->executeUpdate(); return $entity; } @@ -132,7 +132,7 @@ abstract class QBMapper { $qb->setValue($column, $qb->createNamedParameter($value, $type)); } - $qb->execute(); + $qb->executeUpdate(); if ($entity->id === null) { // When autoincrement is used id is always an int @@ -208,7 +208,7 @@ abstract class QBMapper { $qb->where( $qb->expr()->eq('id', $qb->createNamedParameter($id, $idType)) ); - $qb->execute(); + $qb->executeUpdate(); return $entity; } @@ -259,19 +259,19 @@ abstract class QBMapper { * @since 14.0.0 */ protected function findOneQuery(IQueryBuilder $query): array { - $cursor = $query->execute(); + $result = $query->executeQuery(); - $row = $cursor->fetch(); + $row = $result->fetch(); if ($row === false) { - $cursor->closeCursor(); + $result->closeCursor(); $msg = $this->buildDebugMessage( 'Did expect one result but found none when executing', $query ); throw new DoesNotExistException($msg); } - $row2 = $cursor->fetch(); - $cursor->closeCursor(); + $row2 = $result->fetch(); + $result->closeCursor(); if ($row2 !== false) { $msg = $this->buildDebugMessage( 'Did not expect more than one result when executing', $query @@ -317,15 +317,15 @@ abstract class QBMapper { * @since 14.0.0 */ protected function findEntities(IQueryBuilder $query): array { - $cursor = $query->execute(); + $result = $query->executeQuery(); $entities = []; - while ($row = $cursor->fetch()) { + while ($row = $result->fetch()) { $entities[] = $this->mapRowToEntity($row); } - $cursor->closeCursor(); + $result->closeCursor(); return $entities; } |