diff options
Diffstat (limited to 'lib/private/Updater/ChangesMapper.php')
-rw-r--r-- | lib/private/Updater/ChangesMapper.php | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/lib/private/Updater/ChangesMapper.php b/lib/private/Updater/ChangesMapper.php index 83a695b571f..c399948ff10 100644 --- a/lib/private/Updater/ChangesMapper.php +++ b/lib/private/Updater/ChangesMapper.php @@ -3,28 +3,9 @@ declare(strict_types=1); /** - * @copyright Copyright (c) 2018 Arthur Schiwon <blizzz@arthur-schiwon.de> - * - * @author Arthur Schiwon <blizzz@arthur-schiwon.de> - * @author Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @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: 2018 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ - namespace OC\Updater; use OCP\AppFramework\Db\DoesNotExistException; @@ -32,6 +13,9 @@ use OCP\AppFramework\Db\QBMapper; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; +/** + * @template-extends QBMapper<Changes> + */ class ChangesMapper extends QBMapper { public const TABLE_NAME = 'whats_new'; @@ -42,19 +26,19 @@ class ChangesMapper extends QBMapper { /** * @throws DoesNotExistException */ - public function getChanges(string $version): ChangesResult { + public function getChanges(string $version): Changes { /* @var $qb IQueryBuilder */ $qb = $this->db->getQueryBuilder(); $result = $qb->select('*') ->from(self::TABLE_NAME) ->where($qb->expr()->eq('version', $qb->createNamedParameter($version))) - ->execute(); + ->executeQuery(); $data = $result->fetch(); $result->closeCursor(); if ($data === false) { throw new DoesNotExistException('Changes info is not present'); } - return ChangesResult::fromRow($data); + return Changes::fromRow($data); } } |