コード例 #1
0
ファイル: Loan.php プロジェクト: Junyue/zidisha2
 public function calculateAmountRaised(Money $totalBidAmount)
 {
     if ($totalBidAmount->lessThan($this->getAmount())) {
         $percentAmountRaised = $totalBidAmount->divide($this->getAmount()->getAmount())->multiply(100)->round(2)->getAmount();
     } else {
         $percentAmountRaised = 100;
     }
     return $this->setAmountRaised($percentAmountRaised);
 }