-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[Documentation] Query Result Formats #11372
Conversation
Page: https://www.doctrine-project.org/projects/doctrine-orm/en/2.19/reference/dql-doctrine-query-language.html#query-result-formats Follow-up of doctrine#11359 The table I suggested is probably not working, since the text for each method is too long. And what I really wanted is to make it more *scanable*. So I tried boldfacing - if this doesn't work, I'll try something else. Questions: 1. This section here is basically the same as https://www.doctrine-project.org/projects/doctrine-orm/en/2.10/reference/dql-doctrine-query-language.html#hydration-modes ! So I'll try to merge them (in another PR), OK? I think the list is a better format (more scanable) - since those methods all work the same, there's no need for a full-blown code sample for each, IMO. 2. `getSingleColumnResult()` is missing.
|
it leads to more concise code. | ||
In parentheses are the constants of the ``Query`` class which you can use with the | ||
general-purpose method ``Query::execute(array $params = [], $hydrationMode = Query::HYDRATE_OBJECT)``. | ||
In fact, the recommended methods in the list are just convenient shortcuts for the hydration mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This phrasing is a bit clumsy I think, it implies the list contains some methods that are recommended, and some methods that are not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, clumsy, indeed! I now deleted "recommended": Since using the method is shorter than using the constant, people will go for it anyway - so no need to explicitly recommend it :-)
Thanks @ThomasLandauer ! |
Page: https://www.doctrine-project.org/projects/doctrine-orm/en/2.19/reference/dql-doctrine-query-language.html#query-result-formats As announced in doctrine#11372 (comment), I merged the (mostly) identical sections. * I changed the `const`s from `Query` to `AbstractQuery` * I deleted this - mainly cause I didn't find a nice place for it: > In parentheses are the constants of the ``Query`` class which you can use with the general-purpose method ``Query::execute(array $params = [], $hydrationMode = Query::HYDRATE_OBJECT)``.
Page: https://www.doctrine-project.org/projects/doctrine-orm/en/2.19/reference/dql-doctrine-query-language.html#query-result-formats As announced in doctrine#11372 (comment), I merged the (mostly) identical sections. * I changed the `const`s from `Query` to `AbstractQuery` * I deleted this - mainly cause I didn't find a nice place for it: > In parentheses are the constants of the ``Query`` class which you can use with the general-purpose method ``Query::execute(array $params = [], $hydrationMode = Query::HYDRATE_OBJECT)``.
Page: https://www.doctrine-project.org/projects/doctrine-orm/en/2.19/reference/dql-doctrine-query-language.html#query-result-formats
Follow-up of #11359
The table I initially suggested is probably not working, since the text for each method is too long. And what I really wanted is to make it more scanable. So I tried boldfacing - if this doesn't work, I'll try something else.
Questions:
This section here is basically the same as https://www.doctrine-project.org/projects/doctrine-orm/en/2.10/reference/dql-doctrine-query-language.html#hydration-modes ! So I'll try to merge them (in another PR), OK? I think the list is a better format (more scanable) - since those methods all work the same, there's no need for a full-blown code sample for each, IMO.
getSingleColumnResult()
is missing.For
getSingleResult
andgetOneOrNullResult
I couldn't find out theconst