You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
Zend\Db\Sql\Predicate\PredicateSet::addPredicate() doesn't consider $this->nextPredicateCombineOrder, and it actually can't do so because $this->nextPredicateCombineOrder is defined in Zend\Db\Sql\Predicate\Predicate which derives from Zend\Db\Sql\Predicate\PredicateSet.
I created two test cases: #6799
Test case 50 succeeds implicitly because the default combine order which is used by Zend\Db\Sql\Predicate\PredicateSet::addPredicate() instead of intended Zend\Db\Sql\Predicate\Predicate::nextPredicateCombineOrder is AND.
Test case 51 however fails, unveiling the observed (mis-) behaviour.
The text was updated successfully, but these errors were encountered:
I have implemented a new method Zend\Db\Sql\Predicate\Predicate::predicate which allows usage of generic predicates fluently when building queries the ->and / ->or way.
The obvious way of extending Zend\Db\Sql\Predicate\PredicateSet::addPredicate() or copying it to Zend\Db\Sql\Predicate\Predicate::addPredicate() which adds logic to utilize Zend\Db\Sql\Predicate\Predicate::nextPredicateCombineOrder doesn't make sense because within Predicate we precisely DON'T want to specify $combination but use Predicate::nextPredicateCombineOrder instead.
Doing so would collide with current usage of addPredicate, e.g. in Zend\Db\Sql\Select::where(), where Zend\Db\Sql\Predicate\PredicateSet::addPredicates() (which in turn calls addPredicate()) is called with Zend\Db\Sql\Select::where()'s default for $combination.
However, I am not entirely happy with the method's name predicate. Alternatives like generic or raw feel even worse. Proposals are welcome ;-)
Zend\Db\Sql\Predicate\PredicateSet::addPredicate()
doesn't consider$this->nextPredicateCombineOrder
, and it actually can't do so because$this->nextPredicateCombineOrder
is defined inZend\Db\Sql\Predicate\Predicate
which derives fromZend\Db\Sql\Predicate\PredicateSet
.I created two test cases: #6799
Test case 50 succeeds implicitly because the default combine order which is used by
Zend\Db\Sql\Predicate\PredicateSet::addPredicate()
instead of intendedZend\Db\Sql\Predicate\Predicate::nextPredicateCombineOrder
is AND.Test case 51 however fails, unveiling the observed (mis-) behaviour.
The text was updated successfully, but these errors were encountered: