当前位置: 首页>>代码示例>>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;未经允许,请勿转载。