當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Transaction::getAmountForReason方法代碼示例

本文整理匯總了PHP中Transaction::getAmountForReason方法的典型用法代碼示例。如果您正苦於以下問題:PHP Transaction::getAmountForReason方法的具體用法?PHP Transaction::getAmountForReason怎麽用?PHP Transaction::getAmountForReason使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Transaction的用法示例。


在下文中一共展示了Transaction::getAmountForReason方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createTransactionForReason

 public function createTransactionForReason(Member $transferOwner, $reason, $advertisedMemberId, $when, PropelPDO $con)
 {
     $amount = Transaction::getAmountForReason($reason);
     $transferOwner->addOutstandingTotal($amount, $this->getCurrency());
     $transaction = $this->addAmount($amount);
     $transaction->setReason($reason);
     $transaction->setRelatedId($advertisedMemberId);
     $transaction->setDate($when);
     $transaction->save($con);
     return $transaction;
 }
開發者ID:nikonehauser,項目名稱:pt,代碼行數:11,代碼來源:Transfer.php

示例2: createTransactionForReason

 public function createTransactionForReason(Member $transferOwner, $reason, $advertisedMemberId, $when, PropelPDO $con)
 {
     if ($reason === Transaction::REASON_CUSTOM_BONUS_LEVEL) {
         $amount = $transferOwner->getBonusLevel();
     } else {
         $amount = Transaction::getAmountForReason($reason);
     }
     $transferOwner->addOutstandingTotal($amount, $this->getCurrency());
     $transaction = $this->addAmount($amount);
     $transaction->setReason($reason);
     $transaction->setRelatedId($advertisedMemberId);
     $transaction->setDate($when);
     $transaction->save($con);
     return $transaction;
 }
開發者ID:nikonehauser,項目名稱:ptclient,代碼行數:15,代碼來源:Transfer.php

示例3: add

 public function add($reason, $quantity = 1)
 {
     $this->total += Transaction::getAmountForReason($reason) * $quantity;
     return $this;
 }
開發者ID:nikonehauser,項目名稱:ptclient,代碼行數:5,代碼來源:helper.php

示例4: getLocalizedTRA

 public static function getLocalizedTRA($transactinoReason)
 {
     return Localizer::numFormat(\Transaction::getAmountForReason($transactinoReason), 0);
 }
開發者ID:nikonehauser,項目名稱:ptclient,代碼行數:4,代碼來源:MailHelper.php

示例5: testVariant12

 public function testVariant12()
 {
     /**
      * OL - Neues Mitglied
      * 22$
      * ------------------------------------------*/
     /* Setup
        ---------------------------------------------*/
     DbEntityHelper::setCon(self::$propelCon);
     list(list($IT, $VL, $OL, $PM, $VS2, $VS1), list($trfIT, $trfVL, $trfOL, $trfPM, $trfVS2, $trfVS1), ) = DbEntityHelper::setUpBonusMembers(true, ['VL' => false]);
     $new = DbEntityHelper::createSignupMember($OL);
     $trfIT += Transaction::getAmountForReason(Transaction::REASON_IT_BONUS);
     // $trfVL += Transaction::getAmountForReason(Transaction::REASON_VL_BONUS);
     $trfOL += Transaction::getAmountForReason(Transaction::REASON_OL_BONUS) + Transaction::getAmountForReason(Transaction::REASON_PM_BONUS) + Transaction::getAmountForReason(Transaction::REASON_ADVERTISED_LVL2);
     // $trfPM += Transaction::getAmountForReason(Transaction::REASON_PM_BONUS);
     // $trfVS2 += Transaction::getAmountForReason(Transaction::REASON_ADVERTISED_INDIRECT);
     // $trfVS1 += Transaction::getAmountForReason(Transaction::REASON_ADVERTISED_LVL1);
     $this->assertTransferTotal($trfIT, $IT);
     // $this->assertTransferTotal($trfVL, $VL);
     $this->assertTransferTotal($trfOL, $OL);
     $this->assertTransferTotal($trfPM, $PM);
     $this->assertTransferTotal($trfVS2, $VS2);
     $this->assertTransferTotal($trfVS1, $VS1);
 }
開發者ID:nikonehauser,項目名稱:pt,代碼行數:24,代碼來源:BonusSpreadingTest.php


注:本文中的Transaction::getAmountForReason方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。