From 7e1c49ad9d69a18c5eea1928ac7c83e70498b406 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Fri, 12 Sep 2025 16:58:19 +0200 Subject: [PATCH] refactor: Port away from IQueryBuilder::execute in apps/ Signed-off-by: Carl Schwan --- .../CleanupInvitationTokenJob.php | 4 ++-- .../AbstractPrincipalBackend.php | 20 ++++++++-------- .../lib/Migration/BuildSocialSearchIndex.php | 24 +++++++------------ .../Migration/RefreshWebcalJobRegistrar.php | 4 ++-- ...emoveDeletedUsersCalendarSubscriptions.php | 4 ++-- .../Version1008Date20181105104826.php | 2 +- .../Version1008Date20181105110300.php | 2 +- .../Version1011Date20201120125158.php | 2 +- apps/files/lib/Command/RepairTree.php | 8 +++---- apps/files_external/lib/Command/Notify.php | 2 +- .../Version1015Date20211104103506.php | 6 ++--- .../lib/Service/DBConfigService.php | 23 ++++++++++++------ .../lib/Migration/OwncloudGuestShareType.php | 2 +- .../lib/Migration/SetPasswordColumn.php | 4 ++-- .../Version11300Date20201120141438.php | 4 ++-- .../files_sharing/lib/ShareBackend/Folder.php | 12 +++++----- apps/settings/lib/Settings/Admin/Server.php | 2 +- .../lib/Db/BackupCodeMapper.php | 2 +- .../Version1002Date20170607113030.php | 4 ++-- apps/workflowengine/lib/Manager.php | 2 +- 20 files changed, 67 insertions(+), 66 deletions(-) diff --git a/apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php b/apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php index 7b664d03181..a5fb8ca7bba 100644 --- a/apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php +++ b/apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php @@ -25,11 +25,11 @@ class CleanupInvitationTokenJob extends TimedJob { $this->setTimeSensitivity(self::TIME_INSENSITIVE); } - public function run($argument) { + public function run($argument): void { $query = $this->db->getQueryBuilder(); $query->delete('calendar_invitations') ->where($query->expr()->lt('expiration', $query->createNamedParameter($this->time->getTime()))) - ->execute(); + ->executeStatement(); } } diff --git a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php index 68bb3373346..0ddd83b6e0d 100644 --- a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php +++ b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php @@ -72,12 +72,12 @@ abstract class AbstractPrincipalBackend implements BackendInterface { $query = $this->db->getQueryBuilder(); $query->select(['id', 'backend_id', 'resource_id', 'email', 'displayname']) ->from($this->dbTableName); - $stmt = $query->execute(); + $stmt = $query->executeQuery(); $metaDataQuery = $this->db->getQueryBuilder(); $metaDataQuery->select([$this->dbForeignKeyName, 'key', 'value']) ->from($this->dbMetaDataTableName); - $metaDataStmt = $metaDataQuery->execute(); + $metaDataStmt = $metaDataQuery->executeQuery(); $metaDataRows = $metaDataStmt->fetchAll(\PDO::FETCH_ASSOC); $metaDataById = []; @@ -128,7 +128,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface { ->from($this->dbTableName) ->where($query->expr()->eq('backend_id', $query->createNamedParameter($backendId))) ->andWhere($query->expr()->eq('resource_id', $query->createNamedParameter($resourceId))); - $stmt = $query->execute(); + $stmt = $query->executeQuery(); $row = $stmt->fetch(\PDO::FETCH_ASSOC); if (!$row) { @@ -139,7 +139,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface { $metaDataQuery->select(['key', 'value']) ->from($this->dbMetaDataTableName) ->where($metaDataQuery->expr()->eq($this->dbForeignKeyName, $metaDataQuery->createNamedParameter($row['id']))); - $metaDataStmt = $metaDataQuery->execute(); + $metaDataStmt = $metaDataQuery->executeQuery(); $metaDataRows = $metaDataStmt->fetchAll(\PDO::FETCH_ASSOC); $metadata = []; @@ -159,7 +159,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface { $query->select(['id', 'backend_id', 'resource_id', 'email', 'displayname']) ->from($this->dbTableName) ->where($query->expr()->eq('id', $query->createNamedParameter($id))); - $stmt = $query->execute(); + $stmt = $query->executeQuery(); $row = $stmt->fetch(\PDO::FETCH_ASSOC); if (!$row) { @@ -170,7 +170,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface { $metaDataQuery->select(['key', 'value']) ->from($this->dbMetaDataTableName) ->where($metaDataQuery->expr()->eq($this->dbForeignKeyName, $metaDataQuery->createNamedParameter($row['id']))); - $metaDataStmt = $metaDataQuery->execute(); + $metaDataStmt = $metaDataQuery->executeQuery(); $metaDataRows = $metaDataStmt->fetchAll(\PDO::FETCH_ASSOC); $metadata = []; @@ -219,7 +219,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface { ->from($this->dbTableName) ->where($query->expr()->iLike('email', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($value) . '%'))); - $stmt = $query->execute(); + $stmt = $query->executeQuery(); $principals = []; while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { if (!$this->isAllowedToAccessResource($row, $usersGroups)) { @@ -238,7 +238,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface { ->from($this->dbTableName) ->where($query->expr()->iLike('displayname', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($value) . '%'))); - $stmt = $query->execute(); + $stmt = $query->executeQuery(); $principals = []; while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { if (!$this->isAllowedToAccessResource($row, $usersGroups)) { @@ -406,7 +406,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface { ->from($this->dbTableName) ->where($query->expr()->eq('email', $query->createNamedParameter($email))); - $stmt = $query->execute(); + $stmt = $query->executeQuery(); $row = $stmt->fetch(\PDO::FETCH_ASSOC); if (!$row) { @@ -433,7 +433,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface { ->from($this->dbTableName) ->where($query->expr()->eq('backend_id', $query->createNamedParameter($backendId))) ->andWhere($query->expr()->eq('resource_id', $query->createNamedParameter($resourceId))); - $stmt = $query->execute(); + $stmt = $query->executeQuery(); $row = $stmt->fetch(\PDO::FETCH_ASSOC); if (!$row) { diff --git a/apps/dav/lib/Migration/BuildSocialSearchIndex.php b/apps/dav/lib/Migration/BuildSocialSearchIndex.php index a808034365a..cf86d2f8a42 100644 --- a/apps/dav/lib/Migration/BuildSocialSearchIndex.php +++ b/apps/dav/lib/Migration/BuildSocialSearchIndex.php @@ -7,29 +7,21 @@ namespace OCA\DAV\Migration; use OCP\BackgroundJob\IJobList; -use OCP\IConfig; +use OCP\IAppConfig; use OCP\IDBConnection; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; class BuildSocialSearchIndex implements IRepairStep { - /** - * @param IDBConnection $db - * @param IJobList $jobList - * @param IConfig $config - */ public function __construct( - private IDBConnection $db, - private IJobList $jobList, - private IConfig $config, + readonly private IDBConnection $db, + readonly private IJobList $jobList, + readonly private IAppConfig $config, ) { } - /** - * @return string - */ - public function getName() { + public function getName(): string { return 'Register building of social profile search index as background job'; } @@ -38,7 +30,7 @@ class BuildSocialSearchIndex implements IRepairStep { */ public function run(IOutput $output) { // only run once - if ($this->config->getAppValue('dav', 'builtSocialSearchIndex') === 'yes') { + if ($this->config->getValueString('dav', 'builtSocialSearchIndex') === 'yes') { $output->info('Repair step already executed'); return; } @@ -47,7 +39,7 @@ class BuildSocialSearchIndex implements IRepairStep { $query->select($query->func()->max('cardid')) ->from('cards_properties') ->where($query->expr()->eq('name', $query->createNamedParameter('X-SOCIALPROFILE'))); - $maxId = (int)$query->execute()->fetchOne(); + $maxId = (int)$query->executeQuery()->fetchOne(); if ($maxId === 0) { return; @@ -60,6 +52,6 @@ class BuildSocialSearchIndex implements IRepairStep { ]); // no need to redo the repair during next upgrade - $this->config->setAppValue('dav', 'builtSocialSearchIndex', 'yes'); + $this->config->setValueString('dav', 'builtSocialSearchIndex', 'yes'); } } diff --git a/apps/dav/lib/Migration/RefreshWebcalJobRegistrar.php b/apps/dav/lib/Migration/RefreshWebcalJobRegistrar.php index cd4b8b31f4d..8f36e1e3762 100644 --- a/apps/dav/lib/Migration/RefreshWebcalJobRegistrar.php +++ b/apps/dav/lib/Migration/RefreshWebcalJobRegistrar.php @@ -38,11 +38,11 @@ class RefreshWebcalJobRegistrar implements IRepairStep { /** * @inheritdoc */ - public function run(IOutput $output) { + public function run(IOutput $output): void { $query = $this->connection->getQueryBuilder(); $query->select(['principaluri', 'uri']) ->from('calendarsubscriptions'); - $stmt = $query->execute(); + $stmt = $query->executeQuery(); $count = 0; while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { diff --git a/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php b/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php index e2b2b701e74..69d27404cdf 100644 --- a/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php +++ b/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php @@ -64,7 +64,7 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep { $query = $qb->select($qb->func()->count('*')) ->from('calendarsubscriptions'); - $result = $query->execute(); + $result = $query->executeQuery(); $count = $result->fetchOne(); $result->closeCursor(); @@ -87,7 +87,7 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep { ->setMaxResults(self::SUBSCRIPTIONS_CHUNK_SIZE) ->setFirstResult($this->progress); - $result = $query->execute(); + $result = $query->executeQuery(); while ($row = $result->fetch()) { $username = $this->getPrincipal($row['principaluri']); if (!$this->userManager->userExists($username)) { diff --git a/apps/dav/lib/Migration/Version1008Date20181105104826.php b/apps/dav/lib/Migration/Version1008Date20181105104826.php index 82612307cbb..3ca80b5a00e 100644 --- a/apps/dav/lib/Migration/Version1008Date20181105104826.php +++ b/apps/dav/lib/Migration/Version1008Date20181105104826.php @@ -55,6 +55,6 @@ class Version1008Date20181105104826 extends SimpleMigrationStep { $qb = $this->connection->getQueryBuilder(); $qb->update('calendarsubscriptions') ->set('source_copy', 'source') - ->execute(); + ->executeStatement(); } } diff --git a/apps/dav/lib/Migration/Version1008Date20181105110300.php b/apps/dav/lib/Migration/Version1008Date20181105110300.php index 72e8dee1bf8..520b950d8ff 100644 --- a/apps/dav/lib/Migration/Version1008Date20181105110300.php +++ b/apps/dav/lib/Migration/Version1008Date20181105110300.php @@ -54,6 +54,6 @@ class Version1008Date20181105110300 extends SimpleMigrationStep { $qb = $this->connection->getQueryBuilder(); $qb->update('calendarsubscriptions') ->set('source', 'source_copy') - ->execute(); + ->executeStatement(); } } diff --git a/apps/federatedfilesharing/lib/Migration/Version1011Date20201120125158.php b/apps/federatedfilesharing/lib/Migration/Version1011Date20201120125158.php index e78c93ec1a5..a57ba916500 100644 --- a/apps/federatedfilesharing/lib/Migration/Version1011Date20201120125158.php +++ b/apps/federatedfilesharing/lib/Migration/Version1011Date20201120125158.php @@ -47,6 +47,6 @@ class Version1011Date20201120125158 extends SimpleMigrationStep { $qb->update('federated_reshares') ->set('remote_id', $qb->createNamedParameter('')) ->where($qb->expr()->eq('remote_id', $qb->createNamedParameter('-1'))); - $qb->execute(); + $qb->executeStatement(); } } diff --git a/apps/files/lib/Command/RepairTree.php b/apps/files/lib/Command/RepairTree.php index 622ccba48a3..e5b28983cf2 100644 --- a/apps/files/lib/Command/RepairTree.php +++ b/apps/files/lib/Command/RepairTree.php @@ -60,7 +60,7 @@ class RepairTree extends Command { 'path' => $row['parent_path'] . '/' . $row['name'], 'storage' => $row['parent_storage'], ]); - $query->execute(); + $query->executeStatement(); } } } @@ -78,14 +78,14 @@ class RepairTree extends Command { ->from('filecache') ->where($query->expr()->eq('storage', $query->createNamedParameter($storage))) ->andWhere($query->expr()->eq('path_hash', $query->createNamedParameter(md5($path)))); - return $query->execute()->fetch(\PDO::FETCH_COLUMN); + return $query->executeQuery()->fetch(\PDO::FETCH_COLUMN); } private function deleteById(int $fileId): void { $query = $this->connection->getQueryBuilder(); $query->delete('filecache') ->where($query->expr()->eq('fileid', $query->createNamedParameter($fileId))); - $query->execute(); + $query->executeStatement(); } private function findBrokenTreeBits(): array { @@ -108,6 +108,6 @@ class RepairTree extends Command { $query->expr()->neq('f.storage', 'p.storage') )); - return $query->execute()->fetchAll(); + return $query->executeQuery()->fetchAll(); } } diff --git a/apps/files_external/lib/Command/Notify.php b/apps/files_external/lib/Command/Notify.php index 0982aa5598b..9f42d974ecf 100644 --- a/apps/files_external/lib/Command/Notify.php +++ b/apps/files_external/lib/Command/Notify.php @@ -176,7 +176,7 @@ class Notify extends StorageAuthBase { ->innerJoin('m', 'filecache', 'f', $qb->expr()->eq('m.storage_id', 'f.storage')) ->where($qb->expr()->eq('mount_id', $qb->createNamedParameter($mountId, IQueryBuilder::PARAM_INT))) ->andWhere($qb->expr()->eq('path_hash', $qb->createNamedParameter($pathHash, IQueryBuilder::PARAM_STR))) - ->execute() + ->executeQuery() ->fetchAll(); } diff --git a/apps/files_external/lib/Migration/Version1015Date20211104103506.php b/apps/files_external/lib/Migration/Version1015Date20211104103506.php index 6027c795cdf..20a279d805c 100644 --- a/apps/files_external/lib/Migration/Version1015Date20211104103506.php +++ b/apps/files_external/lib/Migration/Version1015Date20211104103506.php @@ -47,7 +47,7 @@ class Version1015Date20211104103506 extends SimpleMigrationStep { try { $qb->setParameter('oldId', $oldId); $qb->setParameter('newId', $newId); - $qb->execute(); + $qb->executeStatement(); $this->logger->info('Migrated s3 storage id for mount with id ' . $mount['mount_id'] . ' to ' . $newId); } catch (Exception $e) { $this->logger->error('Failed to migrate external s3 storage id for mount with id ' . $mount['mount_id'], [ @@ -70,7 +70,7 @@ class Version1015Date20211104103506 extends SimpleMigrationStep { ->innerJoin('m', 'external_config', 'c', 'c.mount_id = m.mount_id') ->where($qb->expr()->eq('m.storage_backend', $qb->createPositionalParameter('amazons3'))) ->andWhere($qb->expr()->eq('c.key', $qb->createPositionalParameter('bucket'))); - return $qb->execute(); + return $qb->executeQuery(); } /** @@ -82,7 +82,7 @@ class Version1015Date20211104103506 extends SimpleMigrationStep { ->from('external_config') ->where($qb->expr()->eq('mount_id', $qb->createPositionalParameter($mountId))); $config = []; - foreach ($qb->execute()->fetchAll() as $row) { + foreach ($qb->executeQuery()->fetchAll() as $row) { $config[$row['key']] = $row['value']; } return $config; diff --git a/apps/files_external/lib/Service/DBConfigService.php b/apps/files_external/lib/Service/DBConfigService.php index 41ec4512d70..5a8ee84ee47 100644 --- a/apps/files_external/lib/Service/DBConfigService.php +++ b/apps/files_external/lib/Service/DBConfigService.php @@ -7,7 +7,7 @@ */ namespace OCA\Files_External\Service; -use Doctrine\DBAL\Exception\UniqueConstraintViolationException; +use OCP\DB\Exception; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; use OCP\Security\ICrypto; @@ -304,8 +304,11 @@ class DBConfigService { ->setValue('mount_id', $builder->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)) ->setValue('key', $builder->createNamedParameter($key, IQueryBuilder::PARAM_STR)) ->setValue('value', $builder->createNamedParameter($value, IQueryBuilder::PARAM_STR)) - ->execute(); - } catch (UniqueConstraintViolationException $e) { + ->executeStatement(); + } catch (Exception $e) { + if ($e->getReason() !== Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) { + throw $e; + } $builder = $this->connection->getQueryBuilder(); $query = $builder->update('external_config') ->set('value', $builder->createNamedParameter($value, IQueryBuilder::PARAM_STR)) @@ -327,8 +330,11 @@ class DBConfigService { ->setValue('mount_id', $builder->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)) ->setValue('key', $builder->createNamedParameter($key, IQueryBuilder::PARAM_STR)) ->setValue('value', $builder->createNamedParameter(json_encode($value), IQueryBuilder::PARAM_STR)) - ->execute(); - } catch (UniqueConstraintViolationException $e) { + ->executeStatement(); + } catch (Exception $e) { + if ($e->getReason() !== Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) { + throw $e; + } $builder = $this->connection->getQueryBuilder(); $query = $builder->update('external_options') ->set('value', $builder->createNamedParameter(json_encode($value), IQueryBuilder::PARAM_STR)) @@ -345,9 +351,12 @@ class DBConfigService { ->setValue('mount_id', $builder->createNamedParameter($mountId)) ->setValue('type', $builder->createNamedParameter($type)) ->setValue('value', $builder->createNamedParameter($value)) - ->execute(); - } catch (UniqueConstraintViolationException $e) { + ->executeStatement(); + } catch (Exception $e) { // applicable exists already + if ($e->getReason() !== Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) { + throw $e; + } } } diff --git a/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php b/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php index 3718306e380..7675bc886be 100644 --- a/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php +++ b/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php @@ -47,7 +47,7 @@ class OwncloudGuestShareType implements IRepairStep { $query->update('share') ->set('share_type', $query->createNamedParameter(IShare::TYPE_GUEST)) ->where($query->expr()->eq('share_type', $query->createNamedParameter(IShare::TYPE_EMAIL))); - $query->execute(); + $query->executeStatement(); } protected function shouldRun() { diff --git a/apps/files_sharing/lib/Migration/SetPasswordColumn.php b/apps/files_sharing/lib/Migration/SetPasswordColumn.php index f60af2817d4..5a2fbaeca93 100644 --- a/apps/files_sharing/lib/Migration/SetPasswordColumn.php +++ b/apps/files_sharing/lib/Migration/SetPasswordColumn.php @@ -49,7 +49,7 @@ class SetPasswordColumn implements IRepairStep { ->set('password', 'share_with') ->where($query->expr()->eq('share_type', $query->createNamedParameter(IShare::TYPE_LINK))) ->andWhere($query->expr()->isNotNull('share_with')); - $result = $query->execute(); + $result = $query->executeStatement(); if ($result === 0) { // No link updated, no need to run the second query @@ -62,7 +62,7 @@ class SetPasswordColumn implements IRepairStep { ->set('share_with', $clearQuery->createNamedParameter(null)) ->where($clearQuery->expr()->eq('share_type', $clearQuery->createNamedParameter(IShare::TYPE_LINK))); - $clearQuery->execute(); + $clearQuery->executeStatement(); } protected function shouldRun() { diff --git a/apps/files_sharing/lib/Migration/Version11300Date20201120141438.php b/apps/files_sharing/lib/Migration/Version11300Date20201120141438.php index c9fe840d422..533612a887e 100644 --- a/apps/files_sharing/lib/Migration/Version11300Date20201120141438.php +++ b/apps/files_sharing/lib/Migration/Version11300Date20201120141438.php @@ -114,11 +114,11 @@ class Version11300Date20201120141438 extends SimpleMigrationStep { return $schema; } - public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) { + public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void { $qb = $this->connection->getQueryBuilder(); $qb->update('share_external') ->set('remote_id', $qb->createNamedParameter('')) ->where($qb->expr()->eq('remote_id', $qb->createNamedParameter('-1'))); - $qb->execute(); + $qb->executeStatement(); } } diff --git a/apps/files_sharing/lib/ShareBackend/Folder.php b/apps/files_sharing/lib/ShareBackend/Folder.php index df5529c3c4a..e28e57c0715 100644 --- a/apps/files_sharing/lib/ShareBackend/Folder.php +++ b/apps/files_sharing/lib/ShareBackend/Folder.php @@ -12,7 +12,7 @@ use OCP\Server; use OCP\Share_Backend_Collection; class Folder extends File implements Share_Backend_Collection { - public function getChildren($itemSource) { + public function getChildren($itemSource): array { $children = []; $parents = [$itemSource]; @@ -22,15 +22,15 @@ class Folder extends File implements Share_Backend_Collection { ->where( $qb->expr()->eq('mimetype', $qb->createNamedParameter('httpd/unix-directory')) ); - $result = $qb->execute(); - $row = $result->fetch(); - $result->closeCursor(); + $result = $qb->executeQuery(); - if ($row = $result->fetchRow()) { + if ($row = $result->fetch()) { $mimetype = (int)$row['id']; } else { $mimetype = -1; } + $result->closeCursor(); + while (!empty($parents)) { $qb = Server::get(IDBConnection::class)->getQueryBuilder(); @@ -44,7 +44,7 @@ class Folder extends File implements Share_Backend_Collection { $qb->expr()->in('parent', $parents) ); - $result = $qb->execute(); + $result = $qb->executeQuery(); $parents = []; while ($file = $result->fetch()) { diff --git a/apps/settings/lib/Settings/Admin/Server.php b/apps/settings/lib/Settings/Admin/Server.php index c0f29ce8f34..c142c26dbd6 100644 --- a/apps/settings/lib/Settings/Admin/Server.php +++ b/apps/settings/lib/Settings/Admin/Server.php @@ -69,7 +69,7 @@ class Server implements IDelegatedSettings { ->orderBy('last_checked', 'ASC') ->setMaxResults(1); - $result = $query->execute(); + $result = $query->executeQuery(); if ($row = $result->fetch()) { $maxAge = (int)$row['last_checked']; } else { diff --git a/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php b/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php index fbbc3d0403c..39cc37af686 100644 --- a/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php +++ b/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php @@ -52,6 +52,6 @@ class BackupCodeMapper extends QBMapper { $qb->delete('twofactor_backupcodes') ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($uid))); - $qb->execute(); + $qb->executeStatement(); } } diff --git a/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170607113030.php b/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170607113030.php index bed733cd413..c880b3df78f 100644 --- a/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170607113030.php +++ b/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170607113030.php @@ -52,7 +52,7 @@ class Version1002Date20170607113030 extends SimpleMigrationStep { $query->select('*') ->from('twofactor_backup_codes') ->orderBy('id', 'ASC'); - $result = $query->execute(); + $result = $query->executeQuery(); $output->startProgress(); while ($row = $result->fetch()) { @@ -63,7 +63,7 @@ class Version1002Date20170607113030 extends SimpleMigrationStep { ->setParameter('user_id', $row['user_id'], IQueryBuilder::PARAM_STR) ->setParameter('code', $row['code'], IQueryBuilder::PARAM_STR) ->setParameter('used', $row['used'], IQueryBuilder::PARAM_INT) - ->execute(); + ->executeStatement(); } $output->finishProgress(); } diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php index 0f41679789d..306f9cd4106 100644 --- a/apps/workflowengine/lib/Manager.php +++ b/apps/workflowengine/lib/Manager.php @@ -366,7 +366,7 @@ class Manager implements IManager { ->set('entity', $query->createNamedParameter($entity)) ->set('events', $query->createNamedParameter(json_encode($events))) ->where($query->expr()->eq('id', $query->createNamedParameter($id))); - $query->execute(); + $query->executeStatement(); $this->connection->commit(); } catch (Exception $e) { $this->connection->rollBack();