mirror of
https://github.com/nextcloud/documentation.git
synced 2026-01-02 17:59:36 +07:00
feat(devmanual): Add \OCP\DB\IResult::fetch deprecation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
committed by
Arthur Schiwon
parent
8cb3a5df91
commit
3e7430fb26
@@ -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
|
||||
|
||||
@@ -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'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user