當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。