Keep 18 compatibility

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-08-20 17:38:33 +02:00
parent 7faa40a20e
commit 5536188892
9 changed files with 565 additions and 278 deletions

View File

@@ -26,7 +26,6 @@ namespace OCA\Deck\Db;
use OCP\AppFramework\Db\Entity;
use OCP\AppFramework\Db\QBMapper;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Diagnostics\IQuery;
use OCP\IDBConnection;
use OCP\IUserManager;
use OCP\Notification\IManager;
@@ -216,8 +215,8 @@ class CardMapper extends QBMapper implements IPermissionMapper {
$qb->select('id,title,duedate,notified')
->from('deck_cards')
->where($qb->expr()->lt('duedate', $qb->createFunction('NOW()')))
->andWhere($qb->expr()->eq('archived', false))
->andWhere($qb->expr()->eq('deleted_at', 0));
->andWhere($qb->expr()->eq('archived', $qb->createNamedParameter(false, IQueryBuilder::PARAM_BOOL)))
->andWhere($qb->expr()->eq('deleted_at', $qb->createNamedParameter(0, IQueryBuilder::PARAM_INT)));
return $this->findEntities($qb);
}

View File

@@ -41,7 +41,7 @@ class StackMapper extends DeckMapper implements IPermissionMapper {
* @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException
* @throws \OCP\AppFramework\Db\DoesNotExistException
*/
public function find($id) {
public function find($id): Stack {
$sql = 'SELECT * FROM `*PREFIX*deck_stacks` ' .
'WHERE `id` = ?';
return $this->findEntity($sql, [$id]);