[DDC-2191] Bug in QueryBuilder::add() method, param $append has no effect for where/having DQL parts Created: 07/Dec/12 Updated: 08/Sep/13 Resolved: 06/Jan/13
|Project:||Doctrine 2 - ORM|
|Affects Version/s:||Git Master|
|Reporter:||Mykola Zyk||Assignee:||Benjamin Eberlei|
Now $append param of QueryBuilder::add() method has no effect for where and having parts.
will result in the loss of condition u.some = ?1
Explanation in code
According to the code above $append parameter is checked in conjunction with $isMultiple variable, which is:
But in 56 line of this file, class property _dqlParts keys where and having are equal null:
As a result, for the parts where and having condition $append && $isMultiple will never be true, regardless of $append value.
I can offer a patch on Github to fix this bug, if necessary.
|Comment by Benjamin Eberlei [ 06/Jan/13 ]|
This was and will never be allowed, i introduced an exception to show a way out, you need to look at QueryBuilder#andWhere for example to see a solution to append to where clauses.