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