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


PHP ActiveRecord::afterDelete方法代码示例

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


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

示例1: afterDelete

 /**
  * Remove images after model deletion
  */
 public function afterDelete()
 {
     // Remove children Photo models
     foreach ($this->photos as $photo) {
         $photo->delete();
     }
     // Remove directory
     FileHelper::removeDirectory(Yii::getAlias('@webroot/images/' . $this->id));
     parent::afterDelete();
 }
开发者ID:CyanoFresh,项目名称:SelectPhoto,代码行数:13,代码来源:Users.php

示例2: afterDelete

 public function afterDelete()
 {
     foreach ($this->books as $book) {
         $book->delete();
     }
     parent::afterDelete();
 }
开发者ID:hehbhehb,项目名称:basic,代码行数:7,代码来源:Author.php

示例3: afterDelete

 public function afterDelete()
 {
     foreach ($this->articleMultArticles as $articleMultArticle) {
         $articleMultArticle->delete();
     }
     parent::afterDelete();
 }
开发者ID:noikiy,项目名称:wowewe,代码行数:7,代码来源:MArticle.php

示例4: afterDelete

 public function afterDelete()
 {
     parent::afterDelete();
     $xs_unicom = new \XS('unicom');
     $xs_index = $xs_unicom->index;
     $xs_index->del($this->id);
 }
开发者ID:noikiy,项目名称:wowewe,代码行数:7,代码来源:UnicomFaq.php

示例5: afterDelete

 /**
  *
  */
 public function afterDelete()
 {
     parent::afterDelete();
     $auth = Yii::$app->authManager;
     $permission = $auth->getPermission($this->name);
     $auth->remove($permission);
 }
开发者ID:jackieit,项目名称:aimocms,代码行数:10,代码来源:AuthRole.php

示例6: afterDelete

 /**
  * Remove images and users after model deletion
  */
 public function afterDelete()
 {
     foreach ($this->users as $user) {
         $user->delete();
     }
     parent::afterDelete();
 }
开发者ID:CyanoFresh,项目名称:SelectPhoto,代码行数:10,代码来源:Project.php

示例7: afterDelete

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

示例8: afterDelete

 public function afterDelete()
 {
     parent::afterDelete();
     if ($this->preview) {
         @unlink(Yii::getAlias('@webroot') . $this->preview);
     }
 }
开发者ID:kolibri1,项目名称:test,代码行数:7,代码来源:Books.php

示例9: afterDelete

 public function afterDelete()
 {
     parent::afterDelete();
     foreach ($this->getShopMedias()->all() as $media) {
         $media->delete();
     }
 }
开发者ID:oakcms,项目名称:oakcms,代码行数:7,代码来源:ContentArticlesMedias.php

示例10: afterDelete

 public function afterDelete()
 {
     foreach ($this->relLibraryBooks as $relLibraryBook) {
         $relLibraryBook->delete();
     }
     parent::afterDelete();
 }
开发者ID:hehbhehb,项目名称:basic,代码行数:7,代码来源:Book.php

示例11: afterDelete

 /**
  * Delete file
  */
 public function afterDelete()
 {
     $root = Yii::getAlias('@webroot');
     if (file_exists($root . $this->path)) {
         unlink($root . $this->path);
     }
     parent::afterDelete();
 }
开发者ID:Cranky4,项目名称:qwen23,代码行数:11,代码来源:Attachment.php

示例12: afterDelete

 public function afterDelete()
 {
     parent::afterDelete();
     foreach ($this->history as $model) {
         $model->delete();
     }
     return true;
 }
开发者ID:zabachok,项目名称:yii2-burivuh,代码行数:8,代码来源:Document.php

示例13: afterDelete

 public function afterDelete()
 {
     $file = Yii::$app->params['uploadSalePath'] . DIRECTORY_SEPARATOR . $this->sale_id . DIRECTORY_SEPARATOR . $this->name;
     if (file_exists($file)) {
         unlink($file);
     }
     return parent::afterDelete();
 }
开发者ID:dench,项目名称:resistor,代码行数:8,代码来源:SaleFiles.php

示例14: afterDelete

 public function afterDelete()
 {
     WarehouseEmail::deleteAll(['warehouse_id' => $this->id]);
     WarehousePhone::deleteAll(['warehouse_id' => $this->id]);
     WarehouseOpeninghours::deleteAll(['warehouse_id' => $this->id]);
     WarehouseProduct::deleteAll(['warehouse_id' => $this->id]);
     return parent::afterDelete();
 }
开发者ID:yii2ApplicationCollect,项目名称:dotplant2,代码行数:8,代码来源:Warehouse.php

示例15: afterDelete

 public function afterDelete()
 {
     parent::afterDelete();
     // Create history record
     $sql = "DELETE FROM `{$this->tableName()}` WHERE `ID` = {$this->attributes['ID']};";
     $this->db->createCommand()->insert('History', ['User' => Yii::$app->user->identity->username, 'Command' => $sql])->execute();
     return true;
 }
开发者ID:sargomir,项目名称:warehouse,代码行数:8,代码来源:MyActiveRecord.php


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