當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。