From f9523aa41993d39d4affd0882b329796121bea5f Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sun, 29 Jan 2012 15:59:45 +0100 Subject: [PATCH] Making the correct usage of LIKE expressions and placeholders explicit --- en/reference/dql-doctrine-query-language.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/en/reference/dql-doctrine-query-language.rst b/en/reference/dql-doctrine-query-language.rst index a9e8e03d6..8350c9a03 100644 --- a/en/reference/dql-doctrine-query-language.rst +++ b/en/reference/dql-doctrine-query-language.rst @@ -317,7 +317,8 @@ Restricting a JOIN clause by additional conditions: .. code-block:: php createQuery("SELECT u FROM CmsUser u LEFT JOIN u.articles a WITH a.topic LIKE '%foo%'"); + $query = $em->createQuery("SELECT u FROM CmsUser u LEFT JOIN u.articles a WITH a.topic LIKE :foo"); + $query->setParameter('foo', '%foo%'); $users = $query->getResult(); Using several Fetch JOINs: