pass array of conditions to doctrine expr()->orx() method

后端 未结 5 1737
忘掉有多难
忘掉有多难 2020-12-25 10:56

I need to construct DQL with a QueryBuilder like this

[QUERY]... AND WHERE e.type = x OR e.type = Y OR e.type = N [...]

I hav

5条回答
  •  执念已碎
    2020-12-25 11:31

    You can also use ... in php like:

    $conditions = array('e.type = x', 'e.type = Y', 'e.type = N');
    $criteria = Criteria::create();
    $criteria->andWhere(Criteria::expr()->orX(...$conditions));
    

提交回复
热议问题