public function beforeDelete() { if ($this->default) { return false; } return parent::beforeDelete(); }
public function beforeDelete() { Comment::model()->deleteAllByAttributes(array('post_id' => $this->id)); return parent::beforeDelete(); }
protected function beforeDelete() { parent::beforeDelete(); return true; }
protected function beforeDelete() { parent::beforeDelete(); ArticleVote::model()->deleteAllByAttributes(array('article'=>$this->id)); $this->getDeleteFileFolder(); // all comments remove CommentArticle::model()->deleteAllByAttributes(array( 'object_pk'=>$this->id )); return true; }
public function beforeDelete() { if($this->status == self::STATUS_APPROVED){ $this->starRatingBack($this->object_pk, $this->rating); } if($this->id_parent == null){ self::model()->deleteAllByAttributes(array('id_parent'=>$this->id)); } return parent::beforeDelete(); }
/** * Delete category pages and childs. * @return boolean */ public function beforeDelete() { // Delete pages $pages = $this->pages; if ($pages) { foreach ($pages as $p) { $p->delete(); } } // Delete all child categories $tree = new PageCategoryTree(); $tree = $tree->buildTree($this->id); if (count($tree) > 0) { foreach ($tree as $child) { $child->delete(); } } return parent::beforeDelete(); }
protected function beforeDelete(){ if(!parent::beforeDelete()) return false; Comment::model()->updateAll(array('user_id'=>0),array('condition'=>'user_id='.$this->id)); ObjectsImages::model()->updateAll(array('uploaded_by'=>null),array('condition'=>'uploaded_by='.$this->id)); Objects::model()->updateAll(array('author'=>null),array('condition'=>'author='.$this->id)); $this->deleteModelDir(); // удалили модель? удаляем и файл и всю папку return true; }