public function afterSave($insert, $changedAttributes) { $this->saveRoleItems(); parent::afterSave($insert, $changedAttributes); }
public function afterDelete() { @unlink(Yii::getAlias($this->fullFileName)); parent::afterDelete(); }
public function beforeSave($insert) { if ($this->is_viewed == 1 && $this->isAttributeChanged('is_viewed')) { $this->last_viewed_at = new Expression('NOW()'); } return parent::beforeSave($insert); }
public function afterSave($insert, $changedAttributes) { parent::afterSave($insert, $changedAttributes); if ($this->balance != $this->getOldAttribute('balance')) { $this->trigger(self::EVENT_AFTER_BALANCE_CHANGE); } }
public function beforeSave($insert) { $this->receivers_provider_data = Json::encode($this->mailingList->listData()); if ($insert) { $this->status = self::STATUS_NEW; } return parent::beforeSave($insert); }
public function afterSave($insert, $changedAttributes) { parent::afterSave($insert, $changedAttributes); if ($insert) { $this->purse->balance = $this->getPurseNewBalance(); $this->purse->update(); } }