afterSave() public method
This method is called at the end of inserting or updating a record.
The default implementation will trigger an EVENT_AFTER_INSERT event when $insert
is true
, or an EVENT_AFTER_UPDATE event if $insert
is false
. The event class used is yii\db\AfterSaveEvent. When overriding this method, make sure you call the parent implementation so that the event is triggered.
public void afterSave ( $insert, $changedAttributes ) | ||
---|---|---|
$insert | boolean |
Whether this method called while inserting a record. If |
$changedAttributes | array |
The old values of attributes that had changed and were saved. You can use this parameter to take action based on the changes made for example send an email when the password had changed or implement audit trail that tracks all the changes. |
Please login to continue.