Skip to content

Commit

Permalink
Readded small note about parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed Feb 3, 2014
1 parent 8bb3195 commit 20ba9e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions book/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,12 @@ The ``QueryBuilder`` object contains every method necessary to build your
query. By calling the ``getQuery()`` method, the query builder returns a
normal ``Query`` object, which can be used to get the result of the query.

.. tip::

Take note of the ``setParameter()`` method. When working with Doctrine,
it's always a good idea to set any external values as "placeholders"
(``:price`` in the example above) as it prevents SQL injection attacks.

The ``getResult()`` method returns an array of results. To get only one
result, you can use ``getSingleResult()`` (which throws exception there is no
result) or ``getOneOrNullResult()``::
Expand Down

0 comments on commit 20ba9e0

Please sign in to comment.