当前位置: 首页>>代码示例>>PHP>>正文


PHP BaseModel::beforeDelete方法代码示例

本文整理汇总了PHP中BaseModel::beforeDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseModel::beforeDelete方法的具体用法?PHP BaseModel::beforeDelete怎么用?PHP BaseModel::beforeDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BaseModel的用法示例。


在下文中一共展示了BaseModel::beforeDelete方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: beforeDelete

 public function beforeDelete()
 {
     if ($this->default) {
         return false;
     }
     return parent::beforeDelete();
 }
开发者ID:Aplay,项目名称:anetika_site,代码行数:7,代码来源:SSystemLanguage.php

示例2: beforeDelete

 public function beforeDelete()
 {
     Comment::model()->deleteAllByAttributes(array('post_id' => $this->id));
     return parent::beforeDelete();
 }
开发者ID:sarfraznawaz2005,项目名称:my-Yii-v1-blog-sample,代码行数:5,代码来源:Post.php

示例3: beforeDelete

 protected function beforeDelete()
 {
     parent::beforeDelete();
     return true;
 }
开发者ID:Aplay,项目名称:myhistorypark_site,代码行数:5,代码来源:Article0.php

示例4: beforeDelete

    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;
    }
开发者ID:Aplay,项目名称:Fastreview_site,代码行数:10,代码来源:Article.php

示例5: beforeDelete

	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();
	}
开发者ID:Aplay,项目名称:Fastreview_site,代码行数:10,代码来源:Comment.php

示例6: 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();
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:23,代码来源:PageCategory.php

示例7: 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;
    }
开发者ID:Aplay,项目名称:Fastreview_site,代码行数:10,代码来源:User.php


注:本文中的BaseModel::beforeDelete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。