Making the correct usage of LIKE expressions and placeholders explicit
This commit is contained in:
parent
b0ec3dfb47
commit
f9523aa419
@ -317,7 +317,8 @@ Restricting a JOIN clause by additional conditions:
|
|||||||
.. code-block:: php
|
.. code-block:: php
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$query = $em->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();
|
$users = $query->getResult();
|
||||||
|
|
||||||
Using several Fetch JOINs:
|
Using several Fetch JOINs:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user