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