File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
developer_manual/app_publishing_maintenance/app_upgrade_guide Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,17 @@ Added Events
8888Added APIs
8989^^^^^^^^^^
9090
91- - TBD
91+ - We now expose ``\OCP\DB\IResult::iterateAssociative ``, ``\OCP\DB\IResult::iterateNumeric `` from doctrine/dbal.
92+ These two methods returns iterators that can be directly used in a `foreach ` to iterate over a SQL query result.
93+ For example:
94+
95+ .. code-block :: php
96+
97+ $result = $qb->executeQuery();
98+ foreach ($result->iterateAssociative() as $row) {
99+ $id = $row['id'];
100+ }
101+ $result->closeCursor();
92102
93103 Changed APIs
94104^^^^^^^^^^^^
@@ -98,7 +108,12 @@ Changed APIs
98108Deprecated APIs
99109^^^^^^^^^^^^^^^
100110
101- - TBD
111+ - The ``\OCP\DB\IResult::fetch `` and ``\OCP\DB\IResult::fetchAll `` are soft-deprecated. Instead you can use
112+ ``\OCP\DB\IResult::fetchAssociative ``, ``\OCP\DB\IResult::fetchNumeric `` and ``\OCP\DB\IResult::fetchOne ``
113+ as replacement for ``\OCP\DB\IResult::fetch ``; and ``\OCP\DB\IResult::fetchAllAssociative ``,
114+ ``\OCP\DB\IResult::fetchAllNumeric `` and ``\OCP\DB\IResult::fetchFirstColumn `` as replacement for
115+ ``\OCP\DB\IResult::fetchAll ``. If you use rector, you can use the Nextcloud33 set, to automatically port
116+ most of your code to the new methods.
102117
103118Removed APIs
104119^^^^^^^^^^^^
You can’t perform that action at this time.
0 commit comments