From eddd6642f5cbbdfcda2f54ae04eb55a9c4915cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20H=C3=A4rtl?= Date: Thu, 22 May 2014 14:14:43 +0200 Subject: [PATCH] Issue 3532: Add note about AR default values to upgrade notes --- docs/guide/intro-upgrade-from-v1.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/guide/intro-upgrade-from-v1.md b/docs/guide/intro-upgrade-from-v1.md index a86b24ec27..185eedee01 100644 --- a/docs/guide/intro-upgrade-from-v1.md +++ b/docs/guide/intro-upgrade-from-v1.md @@ -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.