Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(devmanual): Add \OCP\DB\IResult::fetch deprecation
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst authored and blizzz committed Jan 19, 2024
commit 3e7430fb2660cd5fee3aeff01fa560343d9c99df
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions developer_manual/basics/storage/database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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'];
}
Expand Down