aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Migration/BuildCalendarSearchIndex.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/Migration/BuildCalendarSearchIndex.php')
-rw-r--r--apps/dav/lib/Migration/BuildCalendarSearchIndex.php55
1 files changed, 10 insertions, 45 deletions
diff --git a/apps/dav/lib/Migration/BuildCalendarSearchIndex.php b/apps/dav/lib/Migration/BuildCalendarSearchIndex.php
index fc9a6d9a559..d8f906f22ee 100644
--- a/apps/dav/lib/Migration/BuildCalendarSearchIndex.php
+++ b/apps/dav/lib/Migration/BuildCalendarSearchIndex.php
@@ -1,28 +1,8 @@
<?php
+
/**
- * @copyright 2017 Georg Ehrke <oc.list@georgehrke.com>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Georg Ehrke <oc.list@georgehrke.com>
- * @author Joas Schilling <coding@schilljs.com>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Migration;
@@ -34,26 +14,11 @@ use OCP\Migration\IRepairStep;
class BuildCalendarSearchIndex implements IRepairStep {
- /** @var IDBConnection */
- private $db;
-
- /** @var IJobList */
- private $jobList;
-
- /** @var IConfig */
- private $config;
-
- /**
- * @param IDBConnection $db
- * @param IJobList $jobList
- * @param IConfig $config
- */
- public function __construct(IDBConnection $db,
- IJobList $jobList,
- IConfig $config) {
- $this->db = $db;
- $this->jobList = $jobList;
- $this->config = $config;
+ public function __construct(
+ private IDBConnection $db,
+ private IJobList $jobList,
+ private IConfig $config,
+ ) {
}
/**
@@ -76,8 +41,8 @@ class BuildCalendarSearchIndex implements IRepairStep {
$query = $this->db->getQueryBuilder();
$query->select($query->createFunction('MAX(' . $query->getColumnName('id') . ')'))
->from('calendarobjects');
- $result = $query->execute();
- $maxId = (int) $result->fetchOne();
+ $result = $query->executeQuery();
+ $maxId = (int)$result->fetchOne();
$result->closeCursor();
$output->info('Add background job');