public function afterSave($ins, $chAttr) { $Account = Account::findOne(['id' => $this->account_id]); $Account->setAttribute('count_autos', self::getAccountCountAutos($this->account_id)); $Account->save(); return parent::afterSave($ins, $chAttr); }
public function afterSave($insert, $attr) { if ($insert) { if ($this->getScenario() == 'client-to-black') { $this->relocateImages(); } } return parent::afterSave($insert, $attr); }
public function afterSave($insert, $changedAttributes) { if (empty($this->userData)) { self::createUserData($this->id); } return parent::afterSave($insert, $changedAttributes); }