Browse Source

Revert back "andWhere()" calls.

ADmad 8 years ago
parent
commit
16cd1c843e

+ 1 - 0
src/Datasource/QueryInterface.php

@@ -18,6 +18,7 @@ namespace Cake\Datasource;
 /**
  * The basis for every query object
  *
+ * @method $this andWhere($conditions, $types = [])
  */
 interface QueryInterface
 {

+ 1 - 1
src/ORM/Association.php

@@ -956,7 +956,7 @@ abstract class Association
         $target = $this->_targetTable;
         if (!empty($options['negateMatch'])) {
             $primaryKey = $query->aliasFields((array)$target->getPrimaryKey(), $this->_name);
-            $query->where(function ($exp) use ($primaryKey) {
+            $query->andWhere(function ($exp) use ($primaryKey) {
                 array_map([$exp, 'isNull'], $primaryKey);
 
                 return $exp;

+ 1 - 1
src/ORM/Association/BelongsToMany.php

@@ -510,7 +510,7 @@ class BelongsToMany extends Association
         $subquery = $this->_appendJunctionJoin($subquery, $conditions);
 
         $query
-            ->where(function ($exp) use ($subquery, $conds) {
+            ->andWhere(function ($exp) use ($subquery, $conds) {
                 $identifiers = [];
                 foreach (array_keys($conds) as $field) {
                     $identifiers = new IdentifierExpression($field);