Permalink
Browse files

Changed the order of the Select condition, to add the first instances…

… PredicateInterface
  • Loading branch information...
1 parent 4474a0f commit ad4fb40a07a1276754f22959027608347116e91d @moura137 committed Jan 9, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 library/Zend/Db/Sql/Select.php
@@ -258,6 +258,10 @@ public function where($predicate, $combination = Predicate\PredicateSet::OP_AND)
// as an Expression predicate
$predicate = new Predicate\Expression($pkey, $pvalue);
+ } elseif ($pvalue instanceof Predicate\PredicateInterface) {
+ // Predicate type is ok
+ $predicate = $pvalue;
+
} elseif (is_string($pkey)) {
// Otherwise, if still a string, do something intelligent with the PHP type provided
@@ -271,9 +275,6 @@ public function where($predicate, $combination = Predicate\PredicateSet::OP_AND)
// otherwise assume that array('foo' => 'bar') means "foo" = 'bar'
$predicate = new Predicate\Operator($pkey, Predicate\Operator::OP_EQ, $pvalue);
}
- } elseif ($pvalue instanceof Predicate\PredicateInterface) {
- // Predicate type is ok
- $predicate = $pvalue;
} else {
// must be an array of expressions (with int-indexed array)
$predicate = new Predicate\Expression($pvalue);

0 comments on commit ad4fb40

Please sign in to comment.