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


PHP Member::getCurrentTransferBundle方法代码示例

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


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

示例1: payAdvertisingFor

 /**
  * Distribute provisions for member signup.
  *
  * ATTENTION: This method does NOT save changes to $advertisedMember. The
  * caller is required to save this object!
  *
  * @param  Member    $advertisedMember
  * @param  PropelPDO $con
  */
 public function payAdvertisingFor(\Member $referrer, \Tbmt\MemberFee $memberFee, \Member $advertisedMember, $currency, $when, \PropelPDO $con)
 {
     $advertisedMemberId = $advertisedMember->getId();
     $transfer = $referrer->getCurrentTransferBundle($currency, $con);
     if ($referrer->getFundsLevel() === \Member::FUNDS_LEVEL1) {
         // @see resources/snowball.txt - processes - P1
         $transaction = $transfer->createTransactionForReason($referrer, \Transaction::REASON_ADVERTISED_LVL1, $advertisedMemberId, $when, $con);
         $memberFee->subtract($transaction->getAmount(), \Transaction::REASON_ADVERTISED_LVL1);
         $parent = $referrer->getMemberRelatedByParentId($con);
         if ($parent) {
             $parentTransfer = $parent->getCurrentTransferBundle($currency, $con);
             $parentTransaction = $parentTransfer->createTransactionForReason($parent, \Transaction::REASON_ADVERTISED_INDIRECT, $advertisedMemberId, $when, $con);
             $memberFee->subtract($parentTransaction->getAmount(), \Transaction::REASON_ADVERTISED_INDIRECT);
             $parentTransfer->save($con);
             $parent->save($con);
         }
     } else {
         // if ( $this->getFundsLevel() >= Member::FUNDS_LEVEL2 ) {
         // @see resources/snowball.txt - processes - P3
         $transaction = $transfer->createTransactionForReason($referrer, \Transaction::REASON_ADVERTISED_LVL2, $advertisedMemberId, $when, $con);
         $memberFee->subtract($transaction->getAmount(), \Transaction::REASON_ADVERTISED_LVL2);
     }
     $transfer->save($con);
     \MemberBonusIds::payBonuses($memberFee, $advertisedMember, $currency, $when, $con);
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:34,代码来源:WaterfallDistStrategy.php

示例2: payAdvertisingFor

 /**
  * Distribute provisions for member signup.
  *
  * ATTENTION: This method does NOT save changes to $advertisedMember. The
  * caller is required to save this object!
  *
  * @param  Member    $advertisedMember
  * @param  PropelPDO $con
  */
 public function payAdvertisingFor(\Member $referrer, \Tbmt\MemberFee $memberFee, \Member $advertisedMember, $currency, $when, $freeFromInvitation, \PropelPDO $con)
 {
     $advertisedMemberId = $advertisedMember->getId();
     $transfer = $referrer->getCurrentTransferBundle($currency, $con);
     $transaction = $transfer->createTransactionForReason($referrer, \Transaction::REASON_ADVERTISED_LVL1, $advertisedMemberId, $when, $con);
     $memberFee->subtract($transaction->getAmount(), \Transaction::REASON_ADVERTISED_LVL1);
     $transfer->save($con);
     \MemberBonusIds::payBonuses($memberFee, $advertisedMember, $currency, $when, $con);
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:18,代码来源:SingleDistStrategy.php

示例3: activity_createBonusTransaction

 public static function activity_createBonusTransaction(Member $login, Member $recipient, array $data, PropelPDO $con)
 {
     $currentTransfer = $recipient->getCurrentTransferBundle(self::$BASE_CURRENCY, $con);
     $when = time();
     $amount = $data['amount'];
     $recipient->addOutstandingTotal($amount, self::$BASE_CURRENCY);
     $transaction = $currentTransfer->addAmount($amount)->setReason(Transaction::REASON_CUSTOM_BONUS)->setPurpose($data['purpose'])->setRelatedId($login->getId())->setDate($when)->save($con);
     $currentTransfer->save($con);
     $recipient->save($con);
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:10,代码来源:Transaction.php

示例4: createBonusTransaction

 public static function createBonusTransaction(Member $login, Member $recipient, array $data, PropelPDO $con)
 {
     $currentTransfer = $recipient->getCurrentTransferBundle(self::$BASE_CURRENCY, $con);
     $when = time();
     if (!$con->beginTransaction()) {
         throw new Exception('Could not begin transaction');
     }
     try {
         $amount = $data['amount'];
         $recipient->addOutstandingTotal($amount, self::$BASE_CURRENCY);
         $transaction = $currentTransfer->addAmount($amount)->setReason(Transaction::REASON_CUSTOM_BONUS)->setPurpose($data['purpose'])->setRelatedId($login->getId())->setDate($when)->save($con);
         $currentTransfer->save($con);
         $recipient->save($con);
         if (!$con->commit()) {
             throw new Exception('Could not commit transaction');
         }
     } catch (Exception $e) {
         $con->rollBack();
         throw $e;
     }
 }
开发者ID:nikonehauser,项目名称:pt,代码行数:21,代码来源:Transaction.php

示例5: getCurrentTransferBundle

 public static function getCurrentTransferBundle(Member $member)
 {
     return $member->getCurrentTransferBundle(self::$currency, self::$con);
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:4,代码来源:helper.php

示例6: doPay

 private static function doPay(\Tbmt\MemberFee $memberFee, $transfer, Member $member, $reason, $relatedId, $currency, $when, PropelPDO $con)
 {
     if ($transfer === null) {
         $transfer = $member->getCurrentTransferBundle($currency, $con);
     }
     $transaction = $transfer->createTransactionForReason($member, $reason, $relatedId, $when, $con);
     $memberFee->subtract($transaction->getAmount(), $reason);
     return $transfer;
 }
开发者ID:nikonehauser,项目名称:pt,代码行数:9,代码来源:Member.php


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