Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

… PredicateInterface
  • Loading branch information...
commit ad4fb40a07a1276754f22959027608347116e91d 1 parent 4474a0f
Renato Moura authored January 09, 2013

Showing 1 changed file with 4 additions and 3 deletions. Show diff stats Hide diff stats

  1. 7  library/Zend/Db/Sql/Select.php
7  library/Zend/Db/Sql/Select.php
@@ -258,6 +258,10 @@ public function where($predicate, $combination = Predicate\PredicateSet::OP_AND)
258 258
                         // as an Expression predicate
259 259
                         $predicate = new Predicate\Expression($pkey, $pvalue);
260 260
 
  261
+                    } elseif ($pvalue instanceof Predicate\PredicateInterface) {
  262
+                        // Predicate type is ok
  263
+                        $predicate = $pvalue;
  264
+                            
261 265
                     } elseif (is_string($pkey)) {
262 266
                         // Otherwise, if still a string, do something intelligent with the PHP type provided
263 267
 
@@ -271,9 +275,6 @@ public function where($predicate, $combination = Predicate\PredicateSet::OP_AND)
271 275
                             // otherwise assume that array('foo' => 'bar') means "foo" = 'bar'
272 276
                             $predicate = new Predicate\Operator($pkey, Predicate\Operator::OP_EQ, $pvalue);
273 277
                         }
274  
-                    } elseif ($pvalue instanceof Predicate\PredicateInterface) {
275  
-                        // Predicate type is ok
276  
-                        $predicate = $pvalue;
277 278
                     } else {
278 279
                         // must be an array of expressions (with int-indexed array)
279 280
                         $predicate = new Predicate\Expression($pvalue);

0 notes on commit ad4fb40

Please sign in to comment.
Something went wrong with that request. Please try again.