Exemplo n.º 1
0
 /**
  * @param Investment $investment
  */
 public function addInvestment(Investment $investment)
 {
     $currentAmount = $this->getCurrentAmount();
     $investmentAmount = $investment->getAmount();
     if ($currentAmount + $investmentAmount > $this->getMaxAmount()) {
         throw new \RuntimeException();
     }
     $this->investments[] = $investment;
 }