Core classCoredna\Kernel\Types

Money

Money objects are immutable. Arithmetic methods return a new instance with the result, handle rounding and ensure currencies match.

Coredna\Kernel\Types\Money

Properties 11

Take no arguments.

# getCurrency()
Currency
Get the currency
# getCurrencyCode()
string
Get the currency code
# getValue()
string
Get the value
# isEqual()
bool
Is the given money object equal?
# isGreaterThan()
bool
Compares the current Money object with the given Money object. Will return true if the current Money object is greater than the given Money object.
# isGreaterThanOrEqual()
bool
Compares the current Money object with the given Money object. Will return true if the current Money object is greater than or equal to the given Money object.
# isLessThan()
bool
Compares the current Money object with the given Money object. Will return true if the current Money object is less than the given Money object.
# isLessThanOrEqual()
bool
Compares the current Money object with the given Money object. Will return true if the current Money object is less than or equal to the given Money object.
# isZero()
bool
Is the money object zero?
# isPositive()
bool
Is the money object positive? (ie Greater than zero)
# isNegative()
bool
Is the money object negative? (ie Less than zero)