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


PHP X2Model::beforeSave方法代码示例

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


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

示例1: beforeSave

 /**
  * Formats data for associatedContacts before saving
  * @return boolean whether or not to save
  */
 public function beforeSave()
 {
     if (isset($this->associatedContacts)) {
         $this->associatedContacts = self::parseContacts($this->associatedContacts);
     }
     return parent::beforeSave();
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:11,代码来源:Opportunity.php

示例2: beforeSave

 /**
  * Fixes up record association, parses dates (since this doesn't use 
  * {@link X2Model::setX2Fields()})
  * @return boolean whether or not to save
  */
 public function beforeSave()
 {
     if ($this->scenario !== 'workflow') {
         $association = self::getAssociationModel($this->associationType, $this->associationId);
         if ($association === null) {
             $this->associationName = 'None';
             $this->associationId = 0;
         } else {
             if ($association->hasAttribute('name')) {
                 $this->associationName = $association->name;
             }
             if ($association->asa('X2TimestampBehavior') !== null) {
                 if ($association->asa('changelog') !== null && Yii::app()->getSuName() == 'Guest') {
                     $association->disableBehavior('changelog');
                 }
                 $association->updateLastActivity();
                 $association->enableBehavior('changelog');
             }
         }
         if ($this->associationName == 'None' && $this->associationType != 'none') {
             $this->associationName = ucfirst($this->associationType);
         }
         $this->dueDate = Formatter::parseDateTime($this->dueDate);
         $this->completeDate = Formatter::parseDateTime($this->completeDate);
     }
     // Whether this is a "timed" action record:
     $timed = $this->isTimedType;
     if (empty($timeSpent) && !empty($this->completeDate) && !empty($this->dueDate) && $timed) {
         $this->timeSpent = $this->completeDate - $this->dueDate;
     }
     return parent::beforeSave();
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:37,代码来源:Actions.php

示例3: beforeSave

 public function beforeSave()
 {
     if (empty($this->associationType)) {
         $this->associationType = 'none';
     }
     if (empty($this->uploadedBy)) {
         $this->uploadedBy = Yii::app()->user->name;
     }
     if (empty($this->name)) {
         $this->name = $this->fileName;
     }
     if ($this->isNewRecord && $this->associationType !== 'theme' && empty($this->accessKey)) {
         $this->accessKey = bin2hex(openssl_random_pseudo_bytes(32));
     }
     $this->getPath();
     return parent::beforeSave();
 }
开发者ID:xl602,项目名称:X2CRM,代码行数:17,代码来源:Media.php

示例4: beforeSave

 public function beforeSave()
 {
     // backwards compatibility check for when leads didn't have first and last name fields
     if (!$this->isNewRecord && !$this->firstName && !$this->lastName && ($this->attributeChanged('firstName') || $this->attributeChanged('lastName'))) {
         $this->name = '';
     }
     return parent::beforeSave();
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:8,代码来源:X2Leads.php

示例5: beforeSave

 /**
  * @return boolean whether or not to save
  */
 public function beforeSave()
 {
     if ($this->trackingKey === null) {
         $this->trackingKey = self::getNewTrackingKey();
     }
     return parent::beforeSave();
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:10,代码来源:Contacts.php


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