예제 #1
0
파일: Tag.php 프로젝트: hersoncruz/ppma
    /**
     * @return void
     */
    public function afterDelete()
    {
        // remove Entry relations
        EntryHasTag::model()->deleteAllByAttributes(array('tagId' => $this->id));

        parent::afterDelete();
    }
예제 #2
0
 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();
 }
예제 #3
0
 protected function afterDelete()
 {
     parent::afterDelete();
     Authassignment::model()->deleteAll("itemname='" . $this->name . "'");
     Authitemchild::model()->deleteAll("parent='" . $this->name . "'");
     Authitemchild::model()->deleteAll("child='" . $this->name . "'");
 }
예제 #4
0
 protected function afterDelete()
 {
     parent::afterDelete();
     if ($this->image) {
         $this->image->delete();
     }
 }
예제 #5
0
 public function afterDelete()
 {
     // delete dependencies
     ManufacturerToStore::model()->deleteAll("manufacturer_id={$this->cacheId}");
     UrlAlias::model()->deleteAll("query='manufacturer_id={$this->cacheId}'");
     parent::afterDelete();
 }
예제 #6
0
 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));
 }
예제 #7
0
 protected function afterDelete()
 {
     foreach ($this->networks as $nw) {
         $nw->delete();
     }
     parent::afterDelete();
 }
예제 #8
0
 public function afterDelete()
 {
     if ($this->fileName && is_file($this->getFilePath())) {
         unlink($this->getFilePath());
     }
     parent::afterDelete();
 }
예제 #9
0
 public function afterDelete()
 {
     parent::afterDelete();
     if ($this->countByAttributes(['event_id' => $this->event_id]) == 0) {
         Events::model()->deleteByPk($this->event_id);
     }
 }
예제 #10
0
 /**
  * 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);
 }
예제 #11
0
 protected function afterDelete()
 {
     parent::afterDelete();
     $file = Yii::getPathOfAlias('webroot') . '/uploads/' . $this->id . '/' . $this->img;
     if (file_exists($file) && !is_dir($file)) {
         unlink($file);
     }
 }
예제 #12
0
 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"));
 }
예제 #13
0
 protected function afterDelete()
 {
     if (parent::afterDelete()) {
         $model = EvaQuestionGroups::model('section=:section', [':section' => 'econEvaMethods']);
         $model->method = $this->id;
         $model->setScenario('delete');
         $model->save();
     }
 }
예제 #14
0
 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();
 }
예제 #15
0
 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();
 }
예제 #17
0
파일: Cams.php 프로젝트: mrtos/OpenNVR
 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;
 }
예제 #18
0
파일: Modules.php 프로젝트: shayanyi/CRM
 /**
  * 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();
     }
 }
예제 #19
0
파일: Topic.php 프로젝트: ruzuojun/shiqu
 /**
  * 删除主题下的评论
  */
 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();
     }
 }
예제 #20
0
 public function afterDelete()
 {
     // delete dependencies
     AttributeGroupDescription::model()->deleteAll("attribute_group_id={$this->cacheId}");
     parent::afterDelete();
 }
예제 #21
0
파일: Post.php 프로젝트: usky105/wqing
 /**
  * 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, '');
 }
예제 #22
0
 public function afterDelete()
 {
     Syslog::add(Logs::LOG_DELETED, 'Удален уровень веб админов № <strong>' . $this->level . '</strong>');
     return parent::afterDelete();
 }
예제 #23
0
파일: User.php 프로젝트: ntquyen/GXC-CMS
 /**
  * Delete information of the User with Afer Delete
  */
 protected function afterDelete()
 {
     parent::afterDelete();
     AuthAssignment::model()->deleteAll('userid = :uid', array(':uid' => $this->user_id));
 }
예제 #24
0
파일: Files.php 프로젝트: BroneKot/CS-Bans
 protected function afterDelete()
 {
     Syslog::add(Logs::LOG_DELETED, 'Удален файл <strong>' . $this->demo_real . '</strong> к бану № <strong>' . $this->bid . '</strong>');
     return parent::afterDelete();
 }
예제 #25
0
 protected function afterDelete()
 {
     parent::afterDelete();
     $this->removeImage();
     $this->_adjustSlideOrderOnDelete();
 }
예제 #26
0
 public function afterDelete()
 {
     $this->hapusTabelUptime();
     return parent::afterDelete();
 }
예제 #27
0
 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();
 }
예제 #29
0
 /**
  * Поведение после удаления
  * @return boolean
  */
 protected function afterDelete()
 {
     parent::afterDelete();
     if (!NewComments::model()->deleteAllByAttributes(array('comment_id' => $this->id))) {
         return false;
     }
     return true;
 }
예제 #30
0
 public function afterDelete()
 {
     $logs = $this->logs;
     if ($logs) {
         foreach ($logs as $log) {
             $log->delete();
         }
     }
     @unlink($this->getImage_path());
     $this->deleteLogos();
     return parent::afterDelete();
 }