-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset dirty attributes after afterSave
#13472
Comments
what exactly is the problem? |
For example:
In afterSave $this->isAttributeChanged('status') return false, even if status has changed. |
you can use |
Ok, that's good. Thanks, @cebe ! But this solution is useless in behavior for EVENT_AFTER_INSERT and EVENT_AFTER_UPDATE For example:
Here is no $changedAttributes :( |
@cube You are my hero! |
Hi there! Any plans for refactoring this behavior? In my case, |
Not in Yii 2.0 but could be done in https://github.com/yiisoft/active-record. Please post your suggestions in an issue there. Thanks. |
In 2014 @cebe have commit changes for this issue #2892 f439520
So, that _oldAttributes can be used in afterSave() method
But now, as I can see it's not working and according framework source _oldAttributes reset before afterSave()
yii2/framework/db/BaseActiveRecord.php
Line 776 in 88f2348
The text was updated successfully, but these errors were encountered: