Skip to content

Commit

Permalink
Deprecate calling QueryBuilder methods with an array argument
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Jan 28, 2020
1 parent ce9b49c commit a30bd1a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ The usage of the `andX()` and `orX()` methods of the `ExpressionBuilder` class h
The usage of the `add()` and `addMultiple()` methods of the `CompositeExpression` class has been deprecated. Use `with()` instead, which returns a new instance.
In the future, the `add*()` methods will be removed and the class will be effectively immutable.

## Deprecated calling `QueryBuilder` methods with an array argument

Calling the `select()`, `addSelect()`, `groupBy()` and `addGroupBy()` methods with an array argument is deprecated.

# Upgrade to 2.10

## Deprecated `Doctrine\DBAL\Event\ConnectionEventArgs` methods
Expand Down
8 changes: 8 additions & 0 deletions lib/Doctrine/DBAL/Query/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ public function add($sqlPartName, $sqlPart, $append = false)
* Specifies an item that is to be returned in the query result.
* Replaces any previously specified selections, if any.
*
* USING AN ARRAY ARGUMENT IS DEPRECATED. This feature will be removed in the next major version.
*
* <code>
* $qb = $conn->createQueryBuilder()
* ->select('u.id', 'p.id')
Expand Down Expand Up @@ -497,6 +499,8 @@ public function distinct() : self
/**
* Adds an item that is to be returned in the query result.
*
* USING AN ARRAY ARGUMENT IS DEPRECATED. This feature will be removed in the next major version.
*
* <code>
* $qb = $conn->createQueryBuilder()
* ->select('u.id')
Expand Down Expand Up @@ -869,6 +873,8 @@ public function orWhere($where)
* Specifies a grouping over the results of the query.
* Replaces any previously specified groupings, if any.
*
* USING AN ARRAY ARGUMENT IS DEPRECATED. This feature will be removed in the next major version.
*
* <code>
* $qb = $conn->createQueryBuilder()
* ->select('u.name')
Expand All @@ -894,6 +900,8 @@ public function groupBy($groupBy)
/**
* Adds a grouping expression to the query.
*
* USING AN ARRAY ARGUMENT IS DEPRECATED. This feature will be removed in the next major version.
*
* <code>
* $qb = $conn->createQueryBuilder()
* ->select('u.name')
Expand Down

0 comments on commit a30bd1a

Please sign in to comment.