/** * @return void */ public function afterDelete() { // remove Entry relations EntryHasTag::model()->deleteAllByAttributes(array('tagId' => $this->id)); parent::afterDelete(); }
public function afterDelete() { if (!$this->orig_id) { Yii::app()->db->createCommand("DELETE FROM bookmarks WHERE user_id = :user_id AND book_id = :book_id AND orig_id IS NOT NULL")->execute(array(":user_id" => $this->user_id, ":book_id" => $this->book_id)); } parent::afterDelete(); }
protected function afterDelete() { parent::afterDelete(); Authassignment::model()->deleteAll("itemname='" . $this->name . "'"); Authitemchild::model()->deleteAll("parent='" . $this->name . "'"); Authitemchild::model()->deleteAll("child='" . $this->name . "'"); }
protected function afterDelete() { parent::afterDelete(); if ($this->image) { $this->image->delete(); } }
public function afterDelete() { // delete dependencies ManufacturerToStore::model()->deleteAll("manufacturer_id={$this->cacheId}"); UrlAlias::model()->deleteAll("query='manufacturer_id={$this->cacheId}'"); parent::afterDelete(); }
protected function afterDelete() { parent::afterDelete(); @unlink(Helper::mediaPath(Product::UPLOAD_ORIGINAL_IMAGE_PATH . $this->image_path, FRONTEND)); @unlink(Helper::mediaPath(Product::UPLOAD_LARGE_IMAGE_PATH . $this->image_path, FRONTEND)); @unlink(Helper::mediaPath(Product::UPLOAD_THUMBNAIL_IMAGE_PATH . $this->image_path, FRONTEND)); }
protected function afterDelete() { foreach ($this->networks as $nw) { $nw->delete(); } parent::afterDelete(); }
public function afterDelete() { if ($this->fileName && is_file($this->getFilePath())) { unlink($this->getFilePath()); } parent::afterDelete(); }
public function afterDelete() { parent::afterDelete(); if ($this->countByAttributes(['event_id' => $this->event_id]) == 0) { Events::model()->deleteByPk($this->event_id); } }
/** * This is invoked after the record is deleted. */ protected function afterDelete() { parent::afterDelete(); $this->value->delete(); Photo::deleteByProduct($this); ProductRelation::model()->deleteAll('pid=' . $this->id . ' OR pr_id=' . $this->id); CatalogRelation::model()->deleteAll('pr_id=' . $this->id); }
protected function afterDelete() { parent::afterDelete(); $file = Yii::getPathOfAlias('webroot') . '/uploads/' . $this->id . '/' . $this->img; if (file_exists($file) && !is_dir($file)) { unlink($file); } }
public function afterDelete() { parent::afterDelete(); $this->book->n_chapters--; $this->book->n_verses -= $this->n_verses; $this->book->n_vars -= $this->n_vars; $this->book->d_vars -= $this->d_vars; $this->book->save(false, array("n_chapters", "n_verses", "n_vars", "d_vars")); }
protected function afterDelete() { if (parent::afterDelete()) { $model = EvaQuestionGroups::model('section=:section', [':section' => 'econEvaMethods']); $model->method = $this->id; $model->setScenario('delete'); $model->save(); } }
public function afterDelete() { parent::afterDelete(); $id = $this->id_usr; // delete history Yii::app()->db->createCommand("DELETE FROM user_lists_usl WHERE idusr_usl={$id}")->execute(); Yii::app()->db->createCommand("DELETE FROM user_files_usf WHERE idusr_usf={$id}")->execute(); Yii::app()->db->createCommand("DELETE FROM permanent_statistics_user_psu WHERE idusr_psu={$id}")->execute(); Yii::app()->db->createCommand("DELETE FROM external_users_history_euh WHERE idusr_euh={$id}")->execute(); }
public function afterDelete() { $qrs = $this->qrs; if ($qrs) { foreach ($qrs as $qr) { $qr->delete(); } } return parent::afterDelete(); }
/** * This method is invoked after deleting a record. * The default implementation raises the {@link onAfterDelete} event. * You may override this method to do postprocessing after the record is deleted. * Make sure you call the parent implementation so that the event is raised properly. * Update records order field in a manner that their values are still successively increased by one (so, there is no gap caused by the deleted record) */ protected function afterDelete() { $model = call_user_func(array(get_class($this), 'model')); $following_records = $model->findAll(array('order' => '`' . $this->orderField . '` ASC', 'condition' => '`' . $this->orderField . '` > ' . $this->{$this->orderField})); foreach ($following_records as $record) { $record->{$this->orderField}--; $record->update(); } return parent::afterDelete(); }
public function afterDelete() { parent::afterDelete(); $shared = Shared::model()->findAllByAttributes(array('cam_id' => $this->id)); foreach ($shared as $s) { Notifications::model()->deleteAllByAttributes(array('shared_id' => $s->id, 'status' => 1)); $s->delete(); } Sessions::model()->deleteAllByAttributes(array('real_id' => $this->id)); Sessions::model()->deleteAllByAttributes(array('real_id' => $this->id . '_low')); return true; }
/** * Clean up after custom modules when they are deleted. Note, this shouldn't be applicable to default modules, * they cannot be deleted, only disabled */ protected function afterDelete() { parent::afterDelete(); if (!$this->custom) { return; } // remove associated Events, Actions, changelog entries, linked records, and Relationships $events = X2Model::model('Events')->findAllByAttributes(array('associationType' => $this->name)); $actions = X2Model::model('Actions')->findAllByAttributes(array('associationType' => $this->name)); $models = array_merge($events, $actions); foreach ($models as $model) { $model->delete(); } }
/** * 删除主题下的评论 */ public function afterDelete() { parent::afterDelete(); $criteria = new CDbCriteria(); $criteria->addCondition("pk_id=" . $this->id); $criteria->addCondition("model='topic'"); $commentModel = Comment::model()->findAll($criteria); foreach ($commentModel as $value) { Comment::model()->findByPk($value->id)->delete(); } $criteria = new CDbCriteria(); $criteria->addCondition("topic_id=" . $this->id); $commentModel = LoveTopic::model()->deleteAll($criteria); $notificationCriteria = new CDbCriteria(); $notificationCriteria->addCondition("pk_id=" . $this->id); $notificationCriteria->addCondition("notification_type='createtopic'"); $notifyModel = NotificationContent::model()->find($notificationCriteria); if ($notifyModel != null) { NotificationContent::model()->findByPk($notifyModel->id)->delete(); } }
public function afterDelete() { // delete dependencies AttributeGroupDescription::model()->deleteAll("attribute_group_id={$this->cacheId}"); parent::afterDelete(); }
/** * This is invoked after the record is deleted. */ protected function afterDelete() { parent::afterDelete(); Comment::model()->deleteAll('post_id=' . $this->id); Tag::model()->updateFrequency($this->tags, ''); }
public function afterDelete() { Syslog::add(Logs::LOG_DELETED, 'Удален уровень веб админов № <strong>' . $this->level . '</strong>'); return parent::afterDelete(); }
/** * Delete information of the User with Afer Delete */ protected function afterDelete() { parent::afterDelete(); AuthAssignment::model()->deleteAll('userid = :uid', array(':uid' => $this->user_id)); }
protected function afterDelete() { Syslog::add(Logs::LOG_DELETED, 'Удален файл <strong>' . $this->demo_real . '</strong> к бану № <strong>' . $this->bid . '</strong>'); return parent::afterDelete(); }
protected function afterDelete() { parent::afterDelete(); $this->removeImage(); $this->_adjustSlideOrderOnDelete(); }
public function afterDelete() { $this->hapusTabelUptime(); return parent::afterDelete(); }
public function afterDelete() { if (is_file(Yii::app()->params['storeImages']['path'] . 'news/' . $this->id . '.png')) { unlink(Yii::app()->params['storeImages']['path'] . 'news/' . $this->id . '.png'); } foreach (glob(Yii::app()->params['storeImages']['thumbPath'] . 'news/*') as $item) { if (is_dir($item)) { if (file_exists($item . "/" . $this->id . ".png")) { unlink($item . "/" . $this->id . ".png"); } } } parent::afterDelete(); }
public function afterDelete() { $this->deleteFile(); parent::afterDelete(); }
/** * Поведение после удаления * @return boolean */ protected function afterDelete() { parent::afterDelete(); if (!NewComments::model()->deleteAllByAttributes(array('comment_id' => $this->id))) { return false; } return true; }
public function afterDelete() { $logs = $this->logs; if ($logs) { foreach ($logs as $log) { $log->delete(); } } @unlink($this->getImage_path()); $this->deleteLogos(); return parent::afterDelete(); }