-
-
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
Add QueryBuilder vs DQL section #5637
Conversation
@@ -793,6 +793,16 @@ For more information on Doctrine's Query Builder, consult Doctrine's | |||
|
|||
.. _book-doctrine-custom-repository-classes: |
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.
The label must be moved (it belongs to the following section).
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.
I moved it below
122290d
to
3346df0
Compare
👍 |
Thanks for help with text tweaking! |
Nice! It's always good to explain when to use which option. However, the section isn't really a versus anymore, it just explains the use-cases for the QueryBuilder. What about merging it with the first paragraph of the QB section? -Instead of writing a DQL string, you can alternatively use a helpful object called
-the ``QueryBuilder`` to build that string for you::
+Instead of writing a DQL string, you can use a helpful object called the
+``QueryBuilder`` to build that string for you. This is usefull when the actual query
+depends on dynamic conditions, as your code soon becomes hard to read with
+DQL as you start to concatenate strings.
+
+.. code-block:: php (I also removed "atlernatively" in the first sentence, as it was redundant because of "Instead of" at the start of the sentence) Ideally, we would show an example that shows dynamic query building, but that hasn't to be changed in this PR. |
Ah indeed, I missed the fact that we have that paragraph. The suggested change really fits better. |
@wouterj I applied your comment |
Instead of writing a DQL string, you can alternatively use a helpful object called | ||
the ``QueryBuilder`` to build that string for you:: | ||
Instead of writing a DQL string, you can use a helpful object called the | ||
``QueryBuilder`` to build that string for you. This is usefull when the actual query |
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.
useful
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.
Fixed
👍 |
1 similar comment
👍 |
Thank you Victor. |
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #5637). Discussion ---------- Add QueryBuilder vs DQL section Describe difference between QueryBuilder and DQL usage. | Q | A | ------------- | --- | Doc fix? | no | New docs? | yes | Applies to | all | Fixed tickets | none Commits ------- cfc5873 Add explanation when to use QueryBuilder instead of DQL
@bocharsky-bw FYI, I merged your pull request into the |
@xabbuh Thanks for information. Will it merge to other branches too? |
Yes, we merge 2.3 into the newer branches from time to time |
Ok, then I think I could delete this branch patch |
Describe difference between QueryBuilder and DQL usage.