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


PHP CActiveRecord::delete方法代码示例

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


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

示例1: delete

 public function delete($hard = false)
 {
     if ($hard === true) {
         return parent::delete();
     }
     return $this->saveAttributes(['updated_at' => time(), 'status' => self::STATUS_DELETED]);
 }
开发者ID:chervand,项目名称:yii-vk-auth,代码行数:7,代码来源:VkAuthActiveRecord.php

示例2: delete

 public function delete()
 {
     if ($this->wlabel_id != Yii::app()->user->getWhiteLabelId()) {
         return false;
     }
     return parent::delete();
 }
开发者ID:yasirgit,项目名称:hotmall,代码行数:7,代码来源:ListingCategory.php

示例3: delete

 public function delete()
 {
     if (!$this->_hasStatus()) {
         return parent::delete();
     }
     $this->status = self::STATUS_DELETED;
     return $this->save(false);
 }
开发者ID:ZyManch,项目名称:zbank,代码行数:8,代码来源:ActiveRecord.php

示例4: delete

 public function delete()
 {
     $status = parent::delete();
     $inversed = Contact::model()->findByAttributes(array('user_id' => $this->contact_id, 'contact_id' => $this->user_id));
     if ($inversed !== null) {
         $inversed->delete();
     }
     return $status;
 }
开发者ID:jayrulez,项目名称:yiisns,代码行数:9,代码来源:Contact.php

示例5: delete

 public function delete()
 {
     foreach ($this->Transactions as $transaction) {
         $transaction->intCorrelation = 0;
         $transaction->intType = 0;
         $transaction->save();
     }
     return parent::delete();
 }
开发者ID:hkhateb,项目名称:linet3,代码行数:9,代码来源:IntCorrelation.php

示例6: delete

 public function delete($hard = false)
 {
     // Do a soft delete if the hard delete is not forced.
     if (!$hard && $this->hasAttribute('deleted')) {
         $this->deleted = 1;
         return $this->save(false);
     }
     parent::delete();
 }
开发者ID:rBoost,项目名称:WRUD,代码行数:9,代码来源:ActiveRecord.php

示例7: delete

 public function delete()
 {
     $users = User::model()->findAll();
     foreach ($users as $user) {
         $IncomeMap = UserIncomeMap::model()->findByPk(array('user_id' => $user->id, 'itemVatCat_id' => $this->id));
         if ($IncomeMap) {
             //'user_id', 'itemVatCat_id'
             $IncomeMap->delete();
         }
     }
     parent::delete();
 }
开发者ID:hkhateb,项目名称:linet3,代码行数:12,代码来源:ItemVatCat.php

示例8: delete

 public function delete()
 {
     foreach ($this->Transactions as $transaction) {
         $transaction->extCorrelation = 0;
         $transaction->save();
     }
     foreach ($this->Bankbooks as $bankbook) {
         $bankbook->extCorrelation = 0;
         $bankbook->save();
     }
     return parent::delete();
 }
开发者ID:hkhateb,项目名称:linet3,代码行数:12,代码来源:ExtCorrelation.php

示例9: delete

 /**
  * Update standart delete action
  */
 public function delete()
 {
     $columns = $this->tableSchema->columns;
     if (array_key_exists('active', $columns)) {
         if ($this->beforeDelete()) {
             $this->active = 0;
             $res = $this->save(false);
             $this->afterDelete();
             return $res;
         }
     }
     return parent::delete();
 }
开发者ID:arossokha,项目名称:ex-comment,代码行数:16,代码来源:ActiveRecord.php

示例10: delete

 public function delete()
 {
     parent::delete();
     $this->dbConnection->createCommand("DELETE FROM ReportUserLastUsedParams WHERE reportId={$this->id}")->execute();
     $this->dbConnection->createCommand("DELETE FROM ReportParameters WHERE reportId={$this->id}")->execute();
     $this->dbConnection->createCommand("DELETE FROM ReportRows WHERE reportId={$this->id}")->execute();
     $groups = $this->groups;
     if (isset($groups) && count($groups) > 0) {
         foreach ($groups as $group) {
             $group->delete();
         }
     }
 }
开发者ID:Jride,项目名称:accounting-thaiconnections,代码行数:13,代码来源:Report.php

示例11: delete

 public function delete()
 {
     /**
      * delete related records
      */
     foreach ($this->relations() as $relName => $relation) {
         if ($relation[0] != self::HAS_MANY && $relation[0] != self::HAS_ONE) {
             continue;
         }
         foreach ($this->{$relName} as $relRecord) {
             $relRecord->delete();
         }
     }
     return parent::delete();
 }
开发者ID:uldisn,项目名称:ldm,代码行数:15,代码来源:BasePfOrderItems.php

示例12: processModel

 /**
  * Recursive function that deletes all children models to the $model.
  * 
  * @param CActiveRecord $model the model to process.
  * @param boolean $delete whether to delete the $model (the top model's deletion is handled by beforeDelete).
  */
 protected function processModel($model, $delete = true)
 {
     foreach ($model->relations() as $relationName => $relation) {
         $type = $relation[0];
         $className = $relation[1];
         $foreignKey = $relation[2];
         if ($type == CActiveRecord::HAS_MANY) {
             foreach ($model->{$relationName} as $subModel) {
                 if (!empty($subModel)) {
                     $this->processModel($subModel);
                 }
             }
         } elseif ($type == CActiveRecord::HAS_ONE) {
             if (!empty($model->{$relationName})) {
                 $this->processModel($model->{$relationName});
             }
         }
     }
     if ($delete) {
         $model->delete();
     }
 }
开发者ID:kostya1017,项目名称:our,代码行数:28,代码来源:RecursiveDeleteBehavior.php

示例13: delete

 /**
  * besides deleting record
  * deletes its core entity as well
  *
  * @return bool|void
  */
 public function delete()
 {
     $id = $this->lb_record_primary_key;
     $coreEntity = $this->getCoreEntity();
     $result = parent::delete();
     if ($result) {
         $coreEntity->delete();
     }
     return $result;
 }
开发者ID:Lucerin,项目名称:Yii-projects,代码行数:16,代码来源:CLBActiveRecord.php

示例14: delete

 public function delete()
 {
     $this->removeFile($this->galleryDir . '/' . $this->getFileName('') . '.' . $this->galleryExt);
     //create image preview for gallery manager
     $this->removeFile($this->galleryDir . '/_' . $this->getFileName('') . '.' . $this->galleryExt);
     foreach ($this->gallery->versions as $version => $actions) {
         $this->removeFile($this->galleryDir . '/' . $this->getFileName($version) . '.' . $this->galleryExt);
     }
     return parent::delete();
 }
开发者ID:kosenka,项目名称:yboard,代码行数:10,代码来源:GalleryPhoto.php

示例15: delete

 public function delete()
 {
     $this->removeFile(Yii::getPathOfAlias('webroot') . '/' . $this->galleryDir . '/' . $this->getFileName('') . '.' . $this->galleryExt);
     $this->removeFile(Yii::getPathOfAlias('webroot') . '/' . $this->galleryDir . '/_' . $this->getFileName('') . '.' . $this->galleryExt);
     $this->removeImages();
     return parent::delete();
 }
开发者ID:hipogea,项目名称:zega,代码行数:7,代码来源:GalleryPhoto.php


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