public function afterDelete() { $Account = Account::findOne(['id' => $this->account_id]); $Account->setAttribute('count_autos', self::getAccountCountAutos($this->account_id)); $Account->save(); return parent::afterDelete(); }