Skip to content

Commit

Permalink
Fix yiisoft#17397: Improve UPGRADE note about Query::select()
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed Jul 2, 2019
1 parent 6b10bbc commit f9a42c6
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions framework/UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,35 @@ for both A and B.
Upgrade from Yii 2.0.20
-----------------------

* `yii\db\Query::select()` and `addSelect()` now normalize the columns when saving them to `$this->select`, so code
that works directly with that property directly may need to be modified.
* `yii\db\Query::select()` and `addSelect()` now normalize the format that columns are stored in when saving them
to `$this->select`, so code that works directly with that property may need to be modified.

For the following code:

```php
$a = $query->select('*');
$b = $query->select('id, name');
```

The value was stored as is i.e.

```php
// a
['*']

// b
['id', 'name']
```

Now it is stored as

```php
// a
['*' => '*']

// b
['id' => 'id', 'name' => 'name']
```

Upgrade from Yii 2.0.16
-----------------------
Expand Down

0 comments on commit f9a42c6

Please sign in to comment.