-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Place DQL in front of QueryBuilder #5302
Conversation
alfonmga
commented
May 23, 2015
Q | A |
---|---|
Doc fix? | yes |
New docs? | no |
Applies to | 2.7 |
Fixed tickets | #5022 |
Place DQL in front of QueryBuilder
Querying for Objects with DQL | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Instead of using the ``QueryBuilder``, you can alternatively write the queries |
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.
Maybe we should change this sentence. The reader doesn't know anything about the query builder yet when reading this paragraph.
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.
How about this. The first part is copied from the QueryBuilder section:
Imagine that you want to query for products, but only return products that
cost more than ``19.99``, ordered from cheapest to most expensive. You can use
Doctrine's native SQL-like language called DQL to do query for this::
Then, the first sentence under Querying for Objects Using Doctrine's Query Builder
should change to be something like:
Instead of writing a DQL string, you can alternatively use a helpful object called
the ``QueryBuilder`` to build that string for you::
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.
👍
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.
@alfonsomga I think @weaverryan's proposal is really nice.
Thank you for your first contribution @alfonsomga. Really nice work! I just left one minor comment about a sentence that we should rewrite a bit I think. |
Thank you for your comment. |
👍 |
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #5302). Discussion ---------- Place DQL in front of QueryBuilder | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.7 | Fixed tickets | #5022 Commits ------- 2335206 Update doctrine.rst ce9456c Place DQL in front of QueryBuilder
…gs that did not make sense anymore Also, adding some extra code blocks to show how to query for one result
Excellent! I've merged this into the 2.3 branch. I also made one more commit afterwards, with a few wordings that didn't make sense with the new ordering (and a few other additions). See sha: 7e7020d. If you see any issues at all with that commit, please let me know! Thanks Alfonso! |
* 2.3: Adding one more note about why we're in config.yml [#5302] Re-reading sections after moving them, and tweaking some things that did not make sense anymore Update doctrine.rst Place DQL in front of QueryBuilder Slight re-wording of new paragraph with the goal of being as short as possible Fix formatting error Created a new section for rotating log files and explained the max_files configuration option Fixes after review Applied comments [BestPractices] restructured text format for the installation instructions template Fix typo Added new recipe on upgrading a major version Fix little title case mistake Created 'upgrade' cookbook section Added XML and PHP configuration samples Added a note about the rotating_file monolog handler Changing back to config.yml and fixing some code block mistakes thanks to Wouter Making the channel handler more useful by showing it on the prod environment
* 2.6: Adding one more note about why we're in config.yml [#5302] Re-reading sections after moving them, and tweaking some things that did not make sense anymore Update doctrine.rst Place DQL in front of QueryBuilder Slight re-wording of new paragraph with the goal of being as short as possible Fix formatting error Created a new section for rotating log files and explained the max_files configuration option Fixes after review Changed comment from # to // Applied comments [BestPractices] restructured text format for the installation instructions template Better illustrate what the "user mistake" is. Fix typo Added new recipe on upgrading a major version Fix little title case mistake Created 'upgrade' cookbook section Added XML and PHP configuration samples Added a note about the rotating_file monolog handler Changing back to config.yml and fixing some code block mistakes thanks to Wouter Making the channel handler more useful by showing it on the prod environment
* 2.8: (21 commits) Adding one more note about why we're in config.yml [#5302] Re-reading sections after moving them, and tweaking some things that did not make sense anymore Update doctrine.rst Place DQL in front of QueryBuilder Slight re-wording of new paragraph with the goal of being as short as possible Fix formatting error Created a new section for rotating log files and explained the max_files configuration option Fixes after review [VarDumper] Add doc for assertDump* assertions Changed comment from # to // Applied comments [BestPractices] restructured text format for the installation instructions template Better illustrate what the "user mistake" is. Fix typo Added new recipe on upgrading a major version Fix little title case mistake Created 'upgrade' cookbook section Added XML and PHP configuration samples Added a note about the rotating_file monolog handler Changing back to config.yml and fixing some code block mistakes thanks to Wouter ...
…me things that did not make sense anymore Also, adding some extra code blocks to show how to query for one result