8000 minor #5637 Add QueryBuilder vs DQL section (bocharsky-bw) · symfony/symfony-docs@c206a57 · GitHub
[go: up one dir, main page]

Skip to content

Commit c206a57

Browse files
committed
minor #5637 Add QueryBuilder vs DQL section (bocharsky-bw)
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
2 parents fdc7f75 + cfc5873 commit c206a57

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

book/doctrine.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,10 @@ covered later), group, etc. For more information, see the official
766766
Querying for Objects Using Doctrine's Query Builder
767767
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
768768

769-
Instead of writing a DQL string, you can alternatively use a helpful object called
770-
the ``QueryBuilder`` to build that string for you::
769+
Instead of writing a DQL string, you can use a helpful object called the
770+
``QueryBuilder`` to build that string for you. This is useful when the actual query
771+
depends on dynamic conditions, as your code soon becomes hard to read with
772+
DQL as you start to concatenate strings::
771773

772774
$repository = $this->getDoctrine()
773775
->getRepository('AppBundle:Product');

0 commit comments

Comments
 (0)
0