public function events() { return [ActiveRecord::EVENT_BEFORE_INSERT => 'beforeInsert', ActiveRecord::EVENT_BEFORE_UPDATE => 'beforeUpdate']; }