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

I hope so, then I found this :

$conditions = array('e.type = x', 'e.type = Y', 'e.type = N');
$orX = $qb->expr()->orX();

foreach ($conditions as $condition) {
    $orX->add($condition);
}

$qb->add('where', $orX);

Using @meze suggestion, you can simplify the code and replace the foreach statement with:

$orX->addMultiple($conditions);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)