-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Ability to disable normalization #214
Comments
Result has |
I totally missed that method. 🤯🤦 Regarding array of array I was playing with it and Result could add new method (jus one) for that like this: // Result.php
public function fetchAllAsArray(): array
{
$data = [];
while ($row = $this->adapter->fetch()) {
$data[] = $this->normalize($row);
}
return $data;
} |
And what's your motivation here to have an array? Why is it better than row? |
As I wrote above: sometimes it's needed to work with arrays anyway, like using But that would be only nice to have. Main point of this issue is solved by pointing me to |
Regarding my last comment in #249 I am closing also this one, because it can be achieved the same way (by extending |
Sometimes is useful to get raw data from DB. For example I am exporting some data into CSV file. In current state of things can't simply pass
$result->fetchAll()
intoCSVResponse
(from Contributte). I need to iterate the array and convertRow
to array first. And if there areDateTime
s, need to convert them as well.When exporting large datasets it's useless to convert to
Row
and toarray
again and stringify everything again.It would be great if we can switch off data normalization. And even better if we could also get
array<array>
instead ofarray<Row>
.Alternative would be ability to provide custom Result class
The text was updated successfully, but these errors were encountered: