Property | Type | Description | |
---|---|---|---|
$currency | ValueObjects\Money\Currency | ||
$money |
Method | Description | |
---|---|---|
__construct ( integer $amount, ValueObjects\Money\Currency $currency ) | Returns a Money object | |
__toString ( ) : string | Returns a string representation of the Money value in format "CUR AMOUNT" (e.g.: EUR 1000) | |
add ( integer $quantity ) : |
Add an integer quantity to the amount and returns a new Money object. | |
fromNative ( ) : static | Returns a Money object from native int amount and string currency code | |
getAmount ( ) : ValueObjects\Number\Integer | Returns money amount | |
getCurrency ( ) : ValueObjects\Money\Currency | Returns money currency | |
multiply ( ValueObjects\Number\Real $multiplier, ValueObjects\Number\RoundingMode $rounding_mode = null ) : |
Multiply the Money amount for a given number and returns a new Money object. | |
sameValueAs ( ValueObjects\ValueObjectInterface $money ) : boolean | Tells whether two Currency are equal by comparing their amount and currency |
public __construct ( integer $amount, ValueObjects\Money\Currency $currency ) | ||
$amount | integer | Amount expressed in the smallest units of $currency (e.g. cents) |
$currency | ValueObjects\Money\Currency | Currency of the money object |
public __toString ( ) : string | ||
return | string |
public static fromNative ( ) : static | ||
return | static |
public getAmount ( ) : ValueObjects\Number\Integer | ||
return | ValueObjects\Number\Integer |
public getCurrency ( ) : ValueObjects\Money\Currency | ||
return | ValueObjects\Money\Currency |
public multiply ( ValueObjects\Number\Real $multiplier, ValueObjects\Number\RoundingMode $rounding_mode = null ) : |
||
$multiplier | ValueObjects\Number\Real | |
$rounding_mode | ValueObjects\Number\RoundingMode | Rounding mode of the operation. Defaults to RoundingMode::HALF_UP. |
return |
public sameValueAs ( ValueObjects\ValueObjectInterface $money ) : boolean | ||
$money | ValueObjects\ValueObjectInterface | |
return | boolean |
protected Currency,ValueObjects\Money $currency | ||
return | ValueObjects\Money\Currency |