Checks if the value represented by this object is negative
public isNegative ( ) : boolean | ||
Результат | boolean |
/** * 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); }