From 8f133eecd3b1d215d46db53e9fbedecd5c677d63 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 8 Jul 2017 11:17:47 -0400 Subject: [PATCH] Deprecate orWhere() and orHaving() These methods behave differently based on the last used query method. This results in code that has fragile temporal coupling, and hard to predict outcomes. Refs #10845 --- src/Database/Query.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Database/Query.php b/src/Database/Query.php index 8b66a44b14d..73290a03311 100644 --- a/src/Database/Query.php +++ b/src/Database/Query.php @@ -995,6 +995,8 @@ public function andWhere($conditions, $types = []) * @see \Cake\Database\Query::where() * @see \Cake\Database\Type * @return $this + * @deprecated 3.5.0 This method creates hard to predict SQL based on the current query state. + * Use `Query::where()` instead as it has more predicatable and easier to understand behavior. */ public function orWhere($conditions, $types = []) { @@ -1210,6 +1212,8 @@ public function andHaving($conditions, $types = []) * @param array $types associative array of type names used to bind values to query. * @see \Cake\Database\Query::orWhere() * @return $this + * @deprecated 3.5.0 This method creates hard to predict SQL based on the current query state. + * Use `Query::having()` instead as it has more predicatable and easier to understand behavior. */ public function orHaving($conditions, $types = []) {