feat(devmanual): Add \OCP\DB\IResult::fetch deprecation

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst
2023-10-05 13:39:43 +02:00
committed by Arthur Schiwon
parent 8cb3a5df91
commit 3e7430fb26
2 changed files with 8 additions and 6 deletions

View File

@@ -176,6 +176,8 @@ Changed APIs
Deprecated APIs
^^^^^^^^^^^^^^^
* ``\OCP\DB\IResult::fetch``: use the new ``fetchAssociative``, ``fetchNumeric`` and ``fetchOne`` instead. If you called ``fetch`` without arguments, ``fetchAssociative`` is the direct replacement. Beware that the new methods throw a different exception.
* ``\OCP\DB\IResult::fetchAll``: use the new ``fetchAllAssociative``, ``fetchAllNumeric`` and ``fetchOne`` instead. If you called ``fetchAll`` without arguments, ``fetchAllAssociative`` is the direct replacement. Beware that the new methods throw a different exception.
* ``\OCP\Preview\BeforePreviewFetchedEvent`` passing ``null`` for ``width, height, crop or mode`` is deprecated. Starting with Nextcloud 31 they are mandatory.
Removed APIs

View File

@@ -35,9 +35,9 @@ Inside your database layer class you can now start running queries like:
$qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT))
);
$cursor = $qb->execute();
$row = $cursor->fetch();
$cursor->closeCursor();
$result = $qb->executeQuery();
$row = $result->fetchAssociative();
$result->closeCursor();
return $row;
}
@@ -183,9 +183,9 @@ To create a mapper, inherit from the mapper base class and call the parent const
$qb->expr()->eq('name', $qb->createNamedParameter($name, IQueryBuilder::PARAM_STR))
);
$cursor = $qb->execute();
$row = $cursor->fetch();
$cursor->closeCursor();
$result = $qb->executeQuery();
$row = $result->fetchAssociative();
$result->closeCursor();
return $row['count'];
}