當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CActiveRecord::beforeDelete方法代碼示例

本文整理匯總了PHP中CActiveRecord::beforeDelete方法的典型用法代碼示例。如果您正苦於以下問題:PHP CActiveRecord::beforeDelete方法的具體用法?PHP CActiveRecord::beforeDelete怎麽用?PHP CActiveRecord::beforeDelete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CActiveRecord的用法示例。


在下文中一共展示了CActiveRecord::beforeDelete方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: beforeDelete

 public function beforeDelete()
 {
     if (!empty($this->jobs)) {
         return false;
     }
     return parent::beforeDelete();
 }
開發者ID:kostya1017,項目名稱:our,代碼行數:7,代碼來源:JobCategory.php

示例2: beforeDelete

 /**
  * Before-delete hook
  *
  * @return type 
  */
 protected function beforeDelete()
 {
     if (!$this->canBeDeleted) {
         return false;
     }
     return parent::beforeDelete();
 }
開發者ID:sanggabee,項目名稱:fmi-mini-market,代碼行數:12,代碼來源:EActiveRecord.php

示例3: beforeDelete

 public function beforeDelete()
 {
     $item = InventoryItems::model()->findByPk($this->item_id);
     $item->qty += $this->qty;
     $item->save();
     return parent::beforeDelete();
 }
開發者ID:KhemPoudel,項目名稱:billingapp,代碼行數:7,代碼來源:SalesInfo.php

示例4: beforeDelete

 /**
  * Make sure we delete any comments
  */
 public function beforeDelete()
 {
     foreach ($this->comments as $comment) {
         $comment->delete();
     }
     return parent::beforeDelete();
 }
開發者ID:hansenmakangiras,項目名稱:yiiframework-cms,代碼行數:10,代碼來源:Blog.php

示例5: beforeDelete

 /**
  *
  **/
 protected function beforeDelete()
 {
     if (parent::beforeDelete()) {
         unlink(Yii::app()->params->imageBasePath . DIRECTORY_SEPARATOR . $this->filename);
     }
     return true;
 }
開發者ID:kbudylov,項目名稱:ttarget,代碼行數:10,代碼來源:OffersImages.php

示例6: beforeDelete

 protected function beforeDelete()
 {
     foreach ($this->candidates() as $candidate) {
         $candidate->delete();
     }
     return parent::beforeDelete();
 }
開發者ID:suhairi,項目名稱:undimada,代碼行數:7,代碼來源:Seats.php

示例7: beforeDelete

 public function beforeDelete()
 {
     parent::beforeDelete();
     foreach ($this->points as $point) {
         $point->delete();
     }
     return true;
 }
開發者ID:ASDAFF,項目名稱:RosYama.2,代碼行數:8,代碼來源:UserAreaShapes.php

示例8: beforeDelete

 protected function beforeDelete()
 {
     if (parent::beforeDelete()) {
         if ($this->demo_real && @unlink(Yii::getPathOfAlias('webroot.include.files') . DIRECTORY_SEPARATOR . $this->demo_file)) {
             return true;
         }
     }
     return false;
 }
開發者ID:BroneKot,項目名稱:CS-Bans,代碼行數:9,代碼來源:Files.php

示例9: beforeDelete

 public function beforeDelete()
 {
     $this->cacheId = $this->attribute_group_id;
     // delete relations
     foreach ($this->attributes as $attribute) {
         $attribute->delete();
     }
     return parent::beforeDelete();
 }
開發者ID:damnpoet,項目名稱:yiicart,代碼行數:9,代碼來源:AttributeGroup.php

示例10: beforeDelete

 protected function beforeDelete()
 {
     foreach ($this->seats() as $seat) {
         $seat->delete();
     }
     foreach ($this->tokens() as $token) {
         $token->delete();
     }
     return parent::beforeDelete();
 }
開發者ID:suhairi,項目名稱:undimada,代碼行數:10,代碼來源:Elections.php

示例11: beforeDelete

 /**
  * Make sure we delete any posts
  */
 public function beforeDelete()
 {
     foreach ($this->posts as $post) {
         $post->delete();
     }
     foreach ($this->subs as $sub) {
         $sub->delete();
     }
     return parent::beforeDelete();
 }
開發者ID:hansenmakangiras,項目名稱:yiiframework-cms,代碼行數:13,代碼來源:ForumTopics.php

示例12: beforeDelete

 protected function beforeDelete()
 {
     $result = parent::beforeDelete();
     if (!$result) {
         return false;
     }
     if ($this->album && $this->album->isCover($this)) {
         $this->coverShouldBeUpdated = true;
     }
     return $result;
 }
開發者ID:vasiliy-pdk,項目名稱:aes,代碼行數:11,代碼來源:File.php

示例13: beforeDelete

 protected function beforeDelete()
 {
     if (parent::beforeDelete()) {
         foreach ($this->catalogProducts as $product) {
             $product->delete();
         }
         return true;
     } else {
         return false;
     }
 }
開發者ID:kvvn,項目名稱:homeforpets,代碼行數:11,代碼來源:CatalogCategory.php

示例14: beforeDelete

 public function beforeDelete()
 {
     /* remove all nodes attached to this mindmap */
     $sql = strtr('DELETE FROM {table} WHERE mindmap_id=:mindmap_id', array('{table}' => Node::model()->tableName()));
     try {
         Yii::app()->db->createCommand($sql)->bindValue(':mindmap_id', $this->id)->execute();
     } catch (Exception $e) {
         echo $e->getMessage();
     }
     return parent::beforeDelete();
 }
開發者ID:schlypel,項目名稱:YiiBackboneBoilerplate,代碼行數:11,代碼來源:Mindmap.php

示例15: beforeDelete

 /**
  * Custom actions before deleting a record
  * @return boolean
  */
 protected function beforeDelete()
 {
     if (parent::beforeDelete()) {
         if ($childs = $this->childs) {
             foreach ($childs as $child) {
                 $child->delete();
             }
         }
         return true;
     }
     return false;
 }
開發者ID:xPashaNx,項目名稱:diet,代碼行數:16,代碼來源:MenuItem.php


注:本文中的CActiveRecord::beforeDelete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。