I'm working on a Symfony app that uses Doctrine as the ORM. I want to run a query with an WHERE foo IN (bar)
clause, and I'm adding the IN bit like so:
$query->andWhereIn('p.foo', $bar);
where $bar is an array of id numbers. Browsing the docs and trying out a few combinations, I was unable to make Doctrine treat the parameter I'm passing there as a named parameter.
As a result, I'm forced to use positional parameters for the rest of the query, too, as you can't mix the two. What, if anything, am I missing?
andWhereIn()
is simply a proxy method for whereIn()
Have you tried to use whereIn()
or did you skip directly to andWhereIn()
?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.