Hi boys
I have follow a problem: I want to get old value of given an attribute in afterSave(). How do i get it?
public function afterSave( $insert, $changedAttributes)
{
parent::afterSave();
......
}
Hi boys
I have follow a problem: I want to get old value of given an attribute in afterSave(). How do i get it?
public function afterSave( $insert, $changedAttributes)
{
parent::afterSave();
......
}
From http://www.yiiframework.com/doc-2.0/yii-db-baseactiverecord.html#afterSave()-detail
$changedAttributes gives you the old attribute values while the active record ($this) has already the new, updated values.