Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit20ba9e0

Browse files
committed
Readded small note about parameters
1 parent8bb3195 commit20ba9e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎book/doctrine.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,12 @@ The ``QueryBuilder`` object contains every method necessary to build your
742742
query. By calling the ``getQuery()`` method, the query builder returns a
743743
normal ``Query`` object, which can be used to get the result of the query.
744744

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+
745751
The ``getResult()`` method returns an array of results. To get only one
746752
result, you can use ``getSingleResult()`` (which throws exception there is no
747753
result) or ``getOneOrNullResult()``::

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp