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


PHP OwnedSecurableItem::beforeSave方法代码示例

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


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

示例1: beforeSave

 protected function beforeSave()
 {
     if (parent::beforeSave()) {
         if (!isset($this->originalAttributeValues['probability'])) {
             $this->resolveStageToProbability();
         }
         return true;
     } else {
         return false;
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:11,代码来源:Opportunity.php

示例2: beforeSave

 protected function beforeSave()
 {
     if (parent::beforeSave()) {
         if (array_key_exists('value', $this->stage->originalAttributeValues)) {
             $this->resolveStageToProbability();
         }
         return true;
     } else {
         return false;
     }
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:11,代码来源:Opportunity.php

示例3: beforeSave

 /**
  * Update latestDateTime based on new related comments
  * (non-PHPdoc)
  * @see Item::beforeSave()
  */
 protected function beforeSave()
 {
     if (parent::beforeSave()) {
         if ($this->comments->isModified() || $this->getIsNewModel()) {
             $this->unrestrictedSet('latestDateTime', DateTimeUtil::convertTimestampToDbFormatDateTime(time()));
         }
         return true;
     } else {
         return false;
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:16,代码来源:SocialItem.php

示例4: beforeSave

 protected function beforeSave()
 {
     if (parent::beforeSave()) {
         $automaticMappingDisabled = OpportunitiesModule::isAutomaticProbabilityMappingDisabled();
         if (!isset($this->originalAttributeValues['probability']) && $automaticMappingDisabled === false) {
             $this->resolveStageToProbability();
         }
         return true;
     } else {
         return false;
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:12,代码来源:Opportunity.php

示例5: beforeSave

 /**
  * Alter hasReadLatest and/or ownerHasReadLatest based on comments being added.
  * (non-PHPdoc)
  * @see Item::beforeSave()
  */
 protected function beforeSave()
 {
     if (parent::beforeSave()) {
         if ($this->comments->isModified() || $this->getIsNewModel()) {
             $this->unrestrictedSet('latestDateTime', DateTimeUtil::convertTimestampToDbFormatDateTime(time()));
             if ($this->getIsNewModel()) {
                 $this->ownerHasReadLatest = true;
             }
         }
         if ($this->comments->isModified()) {
             foreach ($this->comments as $comment) {
                 if ($comment->id < 0) {
                     if (Yii::app()->user->userModel != $this->owner) {
                         $this->ownerHasReadLatest = false;
                     }
                     foreach ($this->conversationParticipants as $position => $participant) {
                         //At this point the createdByUser is not populated yet in the comment, so we can
                         //use the current user.
                         if ($participant->person->getClassId('Item') != Yii::app()->user->userModel->getClassId('Item')) {
                             $this->conversationParticipants[$position]->hasReadLatest = false;
                         }
                     }
                 }
             }
         }
         return true;
     } else {
         return false;
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:35,代码来源:Conversation.php

示例6: beforeSave

 /**
  * Alter takenByUserHasReadLatest and/or ownerHasReadLatest based on comments being added.
  * (non-PHPdoc)
  * @see Item::beforeSave()
  */
 protected function beforeSave()
 {
     $missionRules = new MissionMashableInboxRules();
     $personsToAddAsHaveNotReadLatest = array();
     if (parent::beforeSave()) {
         if ($this->getIsNewModel()) {
             $this->unrestrictedSet('latestDateTime', DateTimeUtil::convertTimestampToDbFormatDateTime(time()));
             $personsToAddAsHaveNotReadLatest = MissionsUtil::resolvePeopleToSendNotificationToOnNewMission($this);
         }
         if (isset($this->originalAttributeValues['status']) && $this->originalAttributeValues['status'] != $this->status && $this->status == self::STATUS_TAKEN) {
             MissionsUtil::markAllUserHasReadLatestExceptOwnerAndTakenBy($this);
         }
         if ($this->comments->isModified()) {
             $this->unrestrictedSet('latestDateTime', DateTimeUtil::convertTimestampToDbFormatDateTime(time()));
             foreach ($this->comments as $comment) {
                 if ($comment->id < 0) {
                     if (Yii::app()->user->userModel != $this->owner) {
                         $this->sendOwnerUnreadCommentNotification = true;
                     }
                     if (Yii::app()->user->userModel != $this->takenByUser && $this->takenByUser->id > 0) {
                         $this->sendTakenByUserUnreadCommentNotification = true;
                     }
                 }
             }
             $people = MissionsUtil::resolvePeopleToSendNotificationToOnNewComment($this, Yii::app()->user->userModel);
             foreach ($people as $person) {
                 if ($missionRules->hasUserReadLatest($this, $person)) {
                     if (!in_array($person, $personsToAddAsHaveNotReadLatest)) {
                         $personsToAddAsHaveNotReadLatest[] = $person;
                     }
                 }
             }
         }
         foreach ($personsToAddAsHaveNotReadLatest as $person) {
             $personWhoHaveNotReadLatest = $missionRules->makePersonWhoHasNotReadLatest($person);
             $personsToAddAsHaveNotReadLatest[] = $personWhoHaveNotReadLatest;
             $this->personsWhoHaveNotReadLatest->add($personWhoHaveNotReadLatest);
         }
         return true;
     } else {
         return false;
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:48,代码来源:Mission.php

示例7: beforeSave

 protected function beforeSave()
 {
     if ($this->togglePausedStatusToActive() && $this->status == static::STATUS_PAUSED) {
         $this->status = static::STATUS_ACTIVE;
     }
     return parent::beforeSave();
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:7,代码来源:Campaign.php


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