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


PHP ActiveRecord::beforeDelete方法代码示例

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


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

示例1: beforeDelete

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

示例2: beforeDelete

 /**
  * @inheritdoc
  */
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         FileHelper::removeDirectory(Yii::$app->file->dir . '/' . $this->id . '/');
         return true;
     }
     return false;
 }
开发者ID:sersid,项目名称:yii2-file-upload,代码行数:11,代码来源:Model.php

示例3: beforeDelete

 public function beforeDelete()
 {
     foreach ($this->getUploads() as $file) {
         $file->delete();
     }
     return parent::beforeDelete();
 }
开发者ID:Vlsirko,项目名称:yii2-uploads,代码行数:7,代码来源:UploadsCollection.php

示例4: beforeDelete

 public function beforeDelete()
 {
     if (!empty($this->image->id)) {
         $this->image->delete();
     }
     return parent::beforeDelete();
 }
开发者ID:bolom009,项目名称:testwork_api,代码行数:7,代码来源:Category.php

示例5: beforeDelete

 public function beforeDelete()
 {
     if (file_exists($this->urlPath)) {
         unlink($this->urlPath);
     }
     return parent::beforeDelete();
 }
开发者ID:bolom009,项目名称:testwork_api,代码行数:7,代码来源:Image.php

示例6: beforeDelete

 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         return unlink($this->filePath . '/' . $this->fileName);
     }
     return false;
 }
开发者ID:andreyvaslv,项目名称:crb,代码行数:7,代码来源:File.php

示例7: beforeDelete

 public function beforeDelete()
 {
     foreach ($this->attachments as $attachment) {
         $attachment->delete();
     }
     return parent::beforeDelete();
 }
开发者ID:kmolchanov,项目名称:qwintry-test,代码行数:7,代码来源:Document.php

示例8: beforeDelete

 public function beforeDelete()
 {
     foreach ($this->object->objectTags as $objectTag) {
         $objectTag->delete();
     }
     return parent::beforeDelete();
 }
开发者ID:app-dev-ru,项目名称:lingnote,代码行数:7,代码来源:ObjectBase.php

示例9: beforeDelete

 public function beforeDelete()
 {
     if (!$this->shift->team->event->active) {
         return false;
     }
     return parent::beforeDelete();
 }
开发者ID:Flashpoint-Artists-Initiative,项目名称:Volunteering,代码行数:7,代码来源:Participant.php

示例10: beforeDelete

 public function beforeDelete()
 {
     $ret = parent::beforeDelete();
     // Remove field values
     $this->getDb()->createCommand()->delete(TourFieldValue::tableName(), ['field_id' => $this->id])->execute();
     return $ret;
 }
开发者ID:phplego,项目名称:testwork1,代码行数:7,代码来源:TourField.php

示例11: beforeDelete

 public function beforeDelete()
 {
     if (!parent::beforeDelete()) {
         return false;
     }
     $this->deleteFilename = $this->filename;
     return true;
 }
开发者ID:Bochozkar,项目名称:stat.ink,代码行数:8,代码来源:BattleImage.php

示例12: beforeDelete

 public function beforeDelete()
 {
     if (unlink(\Yii::getAlias('@webroot') . '/' . Yii::$app->params['uploadPath'] . $this->avatar) && unlink(\Yii::getAlias('@webroot') . '/' . Yii::$app->params['uploadPreviewPath'] . $this->avatar)) {
         return parent::beforeDelete();
     } else {
         return false;
     }
 }
开发者ID:defektrain,项目名称:sgm-rest,代码行数:8,代码来源:Profile.php

示例13: beforeDelete

 public function beforeDelete()
 {
     $file = $this->getImagePath() . $this->file;
     if (file_exists($file) && !is_dir($file)) {
         unlink($file);
     }
     return parent::beforeDelete();
 }
开发者ID:mops1k,项目名称:yiimine,代码行数:8,代码来源:TestImage.php

示例14: beforeDelete

 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         $this->deletePreview();
         return TRUE;
     }
     return FALSE;
 }
开发者ID:xenm321,项目名称:test,代码行数:8,代码来源:Books.php

示例15: beforeDelete

 public function beforeDelete()
 {
     if (!parent::beforeDelete()) {
         return false;
     }
     Settings::deleteDocument();
     return true;
 }
开发者ID:octoweb,项目名称:yii2-settings,代码行数:8,代码来源:Settings.php


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