Question on the yii2 framework.
How to find out in afterSave, has the field value changed?
I work with notifications to issue a message when a particular field has changed.
Here I use this scheme, when insert all the rules, I find out the necessary data
public function afterSave($insert, $changedAttributes) { if ($insert) { // Да это новая запись (insert) } else { // Нет, старая (update) } parent::afterSave($insert, $changedAttributes); } But what about update? I, for example, have a status - 0/1 field status - 0/1 . If the value has changed, I need to find out the id of the record, and write it to another table. How to do this, can someone dock?