public isNegative ( ) : boolean | ||
리턴 | boolean |
public function isNegative()
{
return $this->compareTo0() === -1;
}
/** * Deposit the given amount to the beneficiary's account * * @param Money $amount * @throws InvalidTransferAmount * A member cannot transfer a negative amount to another member */ protected function applyDeposit(Money $amount) { if ($amount->isNegative()) { throw new InvalidTransferAmount("Cannot transfer negative amount {$amount->getAmount()}"); } $this->account->deposit($amount); }