core/behaviors/TimestampBehavior.php
public function beforeUpdate($event)
    {
        foreach ($this->update as $field) {
            $event->sender->$field = time();
        }
    }
public function beforeUpdate($event)
    {
        foreach ($this->update as $field) {
            $event->sender->$field = time();
        }
    }
public function beforeUpdate ( $ event ) { foreach ( $ this -> update as $ field ) { $ event -> sender -> $ field = time ( ) ; } }
Update the timestamp for all provided fields.

@param \yii\base\Event $event Event object from Active Record.
Update the timestamp for all provided fields .