| Q | A
|------------ | ------
| BC Break | no sure?
| Version | 2.6.2
getScalarResult does not return integer or floats just strings it should convert scalar fields like integer, floats into the correct format.
getScalarResult return all columns as strings instead of scalar values.
Use getScalarResult on a query which should return integer, float fields.
getScalarResult should return scalar types in correct type instead of string. Maybe add a new method getRawResult for returning all fields as string.
This is correct and expected, since there is no way for the ORM to know what kind of mapping is to be used for a retrieved value.
Should we use the DQL AST to decide what kind of type the retrieved value should have, then we'd be introducing a BC break for consumers that rely on the value being string right now.
Closing as invalid.
@Ocramius thx for your answer. Think getScalarResult is misleading and should maybe be renamed in the next major release then. And then a hydration mode which really return only scalar values could be introduced.
We can maybe add a method, and deprecate this one, but changing it is too
risky, given the amount of consumers.
On 5 Nov 2018 10:34, "Alexander Schranz" notifications@github.com wrote:
@Ocramius https://github.com/Ocramius thx for your answer. Think
getScalarResult is misleading and should maybe be renamed in the next major
release then. And then a hydration mode which really return only scalar
values could be introduced.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/doctrine/doctrine2/issues/7447#issuecomment-435810535,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJakORKhJ6VbTHkmU22Cjyi8An3A0QMks5usAYxgaJpZM4YBoaU
.
Most helpful comment
@Ocramius thx for your answer. Think
getScalarResultis misleading and should maybe be renamed in the next major release then. And then a hydration mode which really return only scalar values could be introduced.