8000 Add QueryBuilder vs DQL section · symfony/symfony-docs@3346df0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3346df0

Browse files
committed
Add QueryBuilder vs DQL section
Describe difference between QueryBuilder and DQL usage
1 parent 6fc096e commit 3346df0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

book/doctrine.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,14 @@ normal ``Query`` object, which can be used to get the result of the query.
791791
For more information on Doctrine's Query Builder, consult Doctrine's
792792
`Query Builder`_ documentation.
793793

794+
DQL vs Query Builder
795+
~~~~~~~~~~~~~~~~~~~~
6922
796+
797+
When the actual query depends on dynamic conditions, your code soon becomes hard
798+
to read as you start to concatenate strings. In these cases, it's better to use
799+
the Doctrine QueryBuilder which provides a fluent interface to dynamically add
800+
every part of the query.
801+
794802
.. _book-doctrine-custom-repository-classes:
795803

796804
Custom Repository Classes

0 commit comments

Comments
 (0)
0