isNegative() public method

Checks if the value represented by this object is negative
public isNegative ( ) : boolean
return boolean
Beispiel #1
0
 /**
  * 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);
 }