本文整理汇总了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;
}
示例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;
}
示例3: add
public function add($reason, $quantity = 1)
{
$this->total += Transaction::getAmountForReason($reason) * $quantity;
return $this;
}
示例4: getLocalizedTRA
public static function getLocalizedTRA($transactinoReason)
{
return Localizer::numFormat(\Transaction::getAmountForReason($transactinoReason), 0);
}
示例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);
}