Skip to content

Commit

Permalink
Deprecate orWhere() and orHaving()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
markstory committed Jul 8, 2017
1 parent 3a52dfc commit 8f133ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Database/Query.php
Expand Up @@ -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 = [])
{
Expand Down Expand Up @@ -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 = [])
{
Expand Down

0 comments on commit 8f133ee

Please sign in to comment.