I want to use the parameter place holder - e.g. ?1 - with the % wild cards. that is, something like: \"u.name LIKE %?1%\" (though this throws an error). The docs have the fo
When binding parameters to queries, DQL pretty much works exactly like PDO (which is what Doctrine2 uses under the hood).
So when using the LIKE statement, PDO treats both the keyword and the % wildcards as a single token. You cannot add the wildcards next to the placeholder. You must append them to the string when you bind the params.
$qb->expr()->like('u.nickname', '?2')
$qb->getQuery()->setParameter(2, '%' . $value . '%');
See this comment in the PHP manual. Hope that helps.