We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8bb3195 commit 20ba9e0Copy full SHA for 20ba9e0
book/doctrine.rst
@@ -742,6 +742,12 @@ The ``QueryBuilder`` object contains every method necessary to build your
742
query. By calling the ``getQuery()`` method, the query builder returns a
743
normal ``Query`` object, which can be used to get the result of the query.
744
745
+.. tip::
746
+
747
+ Take note of the ``setParameter()`` method. When working with Doctrine,
748
+ it's always a good idea to set any external values as "placeholders"
749
+ (``:price`` in the example above) as it prevents SQL injection attacks.
750
751
The ``getResult()`` method returns an array of results. To get only one
752
result, you can use ``getSingleResult()`` (which throws exception there is no
753
result) or ``getOneOrNullResult()``::
0 commit comments