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


PHP CActiveRecordBehavior::beforeDelete方法代码示例

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


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

示例1: beforeDelete

 public function beforeDelete($event)
 {
     foreach ($this->findAllAttaches() as $attach) {
         $attach->delete();
     }
     return parent::beforeDelete($event);
 }
开发者ID:nizsheanez,项目名称:kur.ru,代码行数:7,代码来源:AttachmentBehavior.php

示例2: beforeDelete

 /** Will remove associated Gallery before object removal */
 public function beforeDelete($event)
 {
     $gallery = $this->getGallery();
     if ($gallery !== null) {
         $gallery->delete();
     }
     parent::beforeDelete($event);
 }
开发者ID:hipogea,项目名称:zega,代码行数:9,代码来源:GalleryBehavior.php

示例3: beforeDelete

 /** Will remove associated Gallery before object removal */
 public function beforeDelete($event)
 {
     if (!empty($this->getOwner()->{$this->idAttribute})) {
         /** @var $gallery Gallery */
         $gallery = Gallery::model()->findByPk($this->getOwner()->{$this->idAttribute});
         $gallery->delete();
     }
     parent::beforeDelete($event);
 }
开发者ID:lidijakralj,项目名称:bober,代码行数:10,代码来源:GalleryBehavior.php

示例4: beforeDelete

 public function beforeDelete($event)
 {
     $model = $this->getOwner();
     $files = FileManager::model()->findAllByAttributes(array('model_id' => get_class($model), 'object_id' => $model->id));
     foreach ($files as $file) {
         $file->delete();
     }
     return parent::beforeDelete($event);
 }
开发者ID:nizsheanez,项目名称:documentation,代码行数:9,代码来源:FileManagerBehavior.php

示例5: beforeDelete

 public function beforeDelete($event)
 {
     parent::beforeDelete($event);
     if ($this->resolveMetaDataModel() !== null) {
         if ($this->resolveMetaDataModel()->checkAccessDelete && Yii::app()->user->checkAccess($this->resolveMetaDataModel()->checkAccessDelete) === false) {
             throw new CHttpException(403, "You are not authorized to perform this action. Access restricted by P3MetaDataBehavior.");
             return false;
         } else {
             $this->resolveMetaDataModel()->delete();
         }
     }
     return true;
 }
开发者ID:ranvirp,项目名称:rdp,代码行数:13,代码来源:P3MetaDataBehavior.php

示例6: beforeDelete

 public function beforeDelete($event)
 {
     $this->removeImages();
     parent::beforeDelete($event);
 }
开发者ID:amavis442,项目名称:yii-image-attachment,代码行数:5,代码来源:ImageAttachmentBehavior.php

示例7: beforeDelete

 public function beforeDelete($event)
 {
     parent::beforeDelete($event);
     //erasing from youtube...
     $utub = $this->getYouTube(true);
     $utub->delete($utub->getFullVideoEntry($this->owner->youtubeId));
     //from our cache...
     Yii::app()->cache->delete('Video::' . $this->owner->youtubeId);
     //and now we will let the method continue on deleting the database entry
     return true;
 }
开发者ID:nurirahmat,项目名称:Yii-Extensions,代码行数:11,代码来源:YouTubeVideo.php

示例8: beforeDelete

 public function beforeDelete($event)
 {
     parent::beforeDelete($event);
     $this->handleCollection();
 }
开发者ID:JimmDiGriz,项目名称:HGApi,代码行数:5,代码来源:CacheDeleteBehavior.php

示例9: beforeDelete

 public function beforeDelete($event)
 {
     Yii::trace('deleting MANY_MANY data for ' . get_class($this->owner), 'system.db.ar.CActiveRecord');
     foreach ($this->owner->relations() as $key => $relation) {
         if ($relation['0'] == CActiveRecord::MANY_MANY) {
             $this->executeManyManyEntry($this->makeManyManyDeleteCommand($relation[2], $this->owner->{$this->owner->tableSchema->primaryKey}, array()));
         }
     }
     return parent::beforeDelete($event);
 }
开发者ID:niranjan2m,项目名称:Voyanga,代码行数:10,代码来源:EAdvancedArBehavior.php

示例10: beforeDelete

 /**
  * @param CModelEvent $event
  */
 public function beforeDelete($event)
 {
     // touch to allow afterDelete() to clearCache()
     foreach ($this->cacheRelations as $cacheRelation) {
         $this->owner->{$cacheRelation};
     }
     parent::beforeDelete($event);
 }
开发者ID:cornernote,项目名称:yii-dressing,代码行数:11,代码来源:YdCacheBehavior.php


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