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


PHP X2Model::beforeDelete方法代码示例

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


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

示例1: beforeDelete

 public function beforeDelete()
 {
     return parent::beforeDelete();
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:4,代码来源:Actions.php

示例2: beforeDelete

 /**
  * Clear out records associated with this quote before deletion.
  */
 public function beforeDelete()
 {
     QuoteProduct::model()->deleteAllByAttributes(array('quoteId' => $this->id));
     // for old relationships generated with incorrect type name
     Relationships::model()->deleteAllByAttributes(array('firstType' => 'quotes', 'firstId' => $this->id));
     // generate action record for history
     $contact = $this->contact;
     if (!empty($contact)) {
         $action = new Actions();
         $action->associationType = 'contacts';
         $action->type = 'quotesDeleted';
         $action->associationId = $contact->id;
         $action->associationName = $contact->name;
         $action->assignedTo = Yii::app()->getSuModel()->username;
         $action->completedBy = Yii::app()->getSuModel()->username;
         $action->createDate = time();
         $action->dueDate = time();
         $action->completeDate = time();
         $action->visibility = 1;
         $action->complete = 'Yes';
         $action->actionDescription = "Deleted Quote: <span style=\"font-weight:bold;\">{$this->id}</span> {$this->name}";
         // Save after deletion of the model so that this action itself doensn't get deleted
         $action->save();
     }
     return parent::beforeDelete();
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:29,代码来源:Quote.php


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