mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-13 22:06:51 +08:00
Issue 3532: Add note about AR default values to upgrade notes
This commit is contained in:
@ -447,6 +447,17 @@ as arrays, which can significantly reduce the needed CPU time and memory if larg
|
||||
$customers = Customer::find()->asArray()->all();
|
||||
```
|
||||
|
||||
Another change is that you can't define attribute default values through public properties anymore.
|
||||
If you need those, you should set them in the init method of your record class.
|
||||
|
||||
```php
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
$this->status = self::STATUS_NEW;
|
||||
}
|
||||
```
|
||||
|
||||
There are many other changes and enhancements to Active Record. Please refer to
|
||||
the [Active Record](db-active-record.md) section for more details.
|
||||
|
||||
|
Reference in New Issue
Block a user