According to this blog post, “Solving the Problem of the Holographic Doctrine, ” you need to do$query->where("(ConditionA OR ConditionB) AND ConditionC");
It might look like this:
Doctrine_Query::create()
->from(...)
->where('A = ? OR B = ?', array(valA, valB))
->andWhere('C = ?', valC);
However, the poster provides a more general solution whereParenWrap(), expanding Doctrine_Query:
DQ::create()
->from(...)
->where('A = ?', valA)
->orWhere('B = ?', valB)
->whereParenWrap()
->andWhere('C = ?', valC);
source
share