i create filter Doctrine''ORM''Query''filter''SQLFilter;
这是查询修改
应用程序::CRM_APP_IDS是1,2,5
$app_ids = $this->getParameter(Application::CRM_APP_IDS);
return "{$targetTableAlias}.application_id IN ($app_ids)";
我得到报价查询IN(1,2,5'(
如何在sqlFilter 中使用IN
我在原则过滤器中这样做-在这个地方没有可用的QueryBuilder-http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/filters.html
更新1
现在我使用loop和where app=或app=或apps=,但也许有人知道更好的方法。
这将是:
$expr = new Expr'Func($x . ' IN', (array) $y);
如doctrine/orm/lib/Doctrine/ORM/Query/Expr.php:443
中所示
我们通过将其添加到QueryBuilder:来使用它
$builder->andWhere($expr);