Browse Source

Merge pull request #10591 from ndm2/3.x-unify-conjugation-order

3.x - Unify conjugation order
José Lorenzo Rodríguez 9 years ago
parent
commit
18f8d1f66b
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/Database/Query.php

+ 5 - 5
src/Database/Query.php

@@ -918,8 +918,8 @@ class Query implements ExpressionInterface, IteratorAggregate
      *   ->where(['title' => 'Foo'])
      *   ->andWhere(function ($exp, $query) {
      *     return $exp
-     *       ->add(['author_id' => 1])
-     *       ->or_(['author_id' => 2]);
+     *       ->or_(['author_id' => 1])
+     *       ->add(['author_id' => 2]);
      *   });
      * ```
      *
@@ -981,8 +981,8 @@ class Query implements ExpressionInterface, IteratorAggregate
      *   ->where(['title' => 'Foo'])
      *   ->orWhere(function ($exp, $query) {
      *     return $exp
-     *       ->add(['author_id' => 1])
-     *       ->or_(['author_id' => 2]);
+     *       ->or_(['author_id' => 1])
+     *       ->add(['author_id' => 2]);
      *   });
      * ```
      *
@@ -1986,7 +1986,7 @@ class Query implements ExpressionInterface, IteratorAggregate
         } else {
             $expression = $this->newExpr()
                 ->setConjunction($conjunction)
-                ->add([$append, $expression], $types);
+                ->add([$expression, $append], $types);
         }
 
         $this->_parts[$part] = $expression;