2019-10-29 07:22:15 -04:00
|
|
|
<?php
|
2019-12-03 13:57:53 -05:00
|
|
|
|
2019-10-29 07:22:15 -04:00
|
|
|
declare(strict_types=1);
|
2019-12-03 13:57:53 -05:00
|
|
|
|
2019-10-29 07:22:15 -04:00
|
|
|
/**
|
2024-05-28 10:42:42 -04:00
|
|
|
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2019-10-29 07:22:15 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCA\Files\Db;
|
|
|
|
|
|
|
|
|
|
use OCP\AppFramework\Db\QBMapper;
|
|
|
|
|
use OCP\IDBConnection;
|
|
|
|
|
|
2023-03-31 03:28:22 -04:00
|
|
|
/**
|
|
|
|
|
* @template-extends QBMapper<TransferOwnership>
|
|
|
|
|
*/
|
2019-10-29 07:22:15 -04:00
|
|
|
class TransferOwnershipMapper extends QBMapper {
|
|
|
|
|
public function __construct(IDBConnection $db) {
|
2019-12-05 08:38:28 -05:00
|
|
|
parent::__construct($db, 'user_transfer_owner', TransferOwnership::class);
|
2019-10-29 07:22:15 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getById(int $id): TransferOwnership {
|
|
|
|
|
$qb = $this->db->getQueryBuilder();
|
|
|
|
|
|
|
|
|
|
$qb->select('*')
|
|
|
|
|
->from($this->getTableName())
|
|
|
|
|
->where(
|
|
|
|
|
$qb->expr()->eq('id', $qb->createNamedParameter($id))
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return $this->findEntity($qb);
|
|
|
|
|
}
|
|
|
|
|
}
|