-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: PdoResult::fetchAll() does not accept string for class name in FETCH_CLASS mode #16177
Labels
Comments
Jeckerson
added
5.0
The issues we want to solve in the 5.0 release
status: high
High
and removed
status: unverified
Unverified
labels
Oct 24, 2022
Jeckerson
added a commit
that referenced
this issue
Oct 24, 2022
5 tasks
Jeckerson
added a commit
that referenced
this issue
Oct 24, 2022
Jeckerson
added a commit
that referenced
this issue
Oct 24, 2022
Jeckerson
added a commit
that referenced
this issue
Oct 24, 2022
Jeckerson
added a commit
that referenced
this issue
Oct 24, 2022
#16177 - Unify args of `fetchAll()` with `PDOStatement::fetchAll()`
Resolved in #16178 Thank you @ccc-emile-antognetti |
Thanks so much for the speedy turnaround! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Questions? Forum: https://phalcon.io/forum or Discord: https://phalcon.io/discord
Describe the bug
A clear and concise description of what the bug is.
When calling
fetchAll
on a Result\PdoResult object using the \PDO::FETCH_CLASS mode, the following error is returned :To Reproduce
Steps to reproduce the behavior:
Call
fetchAll
on a Result\PdoResult object using FETCH_CLASS modeExpected behavior
fetchAll
should return instances of the specified class, mapping the columns of each row to named properties in the class.https://www.php.net/manual/en/pdostatement.fetchall.php
Screenshots
If applicable, add screenshots to help explain your problem.
Details
Additional context
The error seems to be thrown because in Phalcon 5, the second argument of the fetchAll function is specified as an
int
cphalcon/phalcon/Db/Result/PdoResult.zep
Line 214 in cfe0df1
Previously in Phalcon 4, no type was set for this argument.
cphalcon/phalcon/Db/Result/Pdo.zep
Lines 180 to 181 in ca304ad
Restricting this argument to an int is problematic because in the FETCH_CLASS mode, the second argument should be a string used to specify the Class that the results should be mapped to
https://www.php.net/manual/en/pdostatement.fetchall.php
The text was updated successfully, but these errors were encountered: