Uh oh!
There was an error while loading. Please reload this page.
feat(database): Add replacements for deprecated fetch and fetchAll - #40655
feat(database): Add replacements for deprecated fetch and fetchAll#40655ChristophWurst wants to merge 6 commits into
Conversation
DBAL deprecated these and will remove them it in the future. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
…hAll Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| * | ||
| * @since 21.0.0 | ||
| */ | ||
| public function fetchFirstColumn(): array; |
There was a problem hiding this comment.
it returns the first column of all results as array<mixed>
There was a problem hiding this comment.
The description is not phrased clearly about that imo, and for better consistency perhaps consider renaming the method to fetchAllFirstColumns or something like that?
Uh oh!
There was an error while loading. Please reload this page.
| * @return mixed | ||
| * | ||
| * @since 21.0.0 | ||
| * @deprecated 28.0.0 use fetchAssociative, fetchNumeric or fetchOne |
There was a problem hiding this comment.
This will be painful :D
Touching all the queries yet again (after query() replacement)
There was a problem hiding this comment.
There was a problem hiding this comment.
Also use the deprecation line from the docs here explaining the default replacement?
There was a problem hiding this comment.
@ChristophWurst Out of context, but I'm just curious to know if there are any plans to introduce Rector to the project. Now that I've touched a bit of code from different parts of the code base, I think it would be a great addition to the mix if we could make everything more consistent across the code base by using an automated refactoring approach with Rector.
…hAll Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
…-result-fetch-associative-fetch-num
Uh oh!
There was an error while loading. Please reload this page.
…hAll Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
…hAll Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
| * @return mixed | ||
| * | ||
| * @since 21.0.0 | ||
| * @deprecated 28.0.0 use fetchAssociative instead of fetch(), fetchNumeric instead of fetch(\PDO::FETCH_NUM) and fetchOne instead of fetch(\PDO::FETCH_COLUMN) |
There was a problem hiding this comment.
| * @deprecated 28.0.0usefetchAssociative instead of fetch(), fetchNumeric instead of fetch(\PDO::FETCH_NUM) and fetchOne instead of fetch(\PDO::FETCH_COLUMN) | |
| * @deprecated 28.0.0usefetchAssociative instead of fetch(), fetchNumeric() instead of fetch(\PDO::FETCH_NUM) and fetchOne() instead of fetch(\PDO::FETCH_COLUMN) |
🤪
There was a problem hiding this comment.
and more brackets for lonely fetchAssociative!
| * @return mixed[] | ||
| * | ||
| * @since 21.0.0 | ||
| * @deprecated 28.0.0 use fetchAllAssociative instead of fetchAll(), fetchAllNumeric instead of fetchAll(FETCH_NUM) and fetchOne instead of fetchAll(FETCH_COLUMN) |
There was a problem hiding this comment.
| * @deprecated 28.0.0usefetchAllAssociative instead of fetchAll(), fetchAllNumeric instead of fetchAll(FETCH_NUM) andfetchOne instead of fetchAll(FETCH_COLUMN) | |
| * @deprecated 28.0.0usefetchAllAssociative instead of fetchAll(), fetchAllNumeric() instead of fetchAll(FETCH_NUM) andfetchFirstColumn() instead of fetchAll(FETCH_COLUMN) |
🤪
ChristophWurst
commented
May 20, 2026
Superseded by #56494 |
Summary
DBAL deprecated these and will remove them it in the future.
TODO
Checklist