|
Open Journal Systems
3.3.0
|
Public Member Functions | |
| __construct ($amount, Currency $currency) | |
| absolute () | |
| add (Money ... $addends) | |
| allocate (array $ratios) | |
| allocateTo ($n) | |
| compare (Money $other) | |
| divide ($divisor, $roundingMode=self::ROUND_HALF_UP) | |
| equals (Money $other) | |
| getAmount () | |
| getCurrency () | |
| greaterThan (Money $other) | |
| greaterThanOrEqual (Money $other) | |
| isNegative () | |
| isPositive () | |
| isSameCurrency (Money $other) | |
| isZero () | |
| jsonSerialize () | |
| lessThan (Money $other) | |
| lessThanOrEqual (Money $other) | |
| mod (Money $divisor) | |
| multiply ($multiplier, $roundingMode=self::ROUND_HALF_UP) | |
| negative () | |
| ratioOf (Money $money) | |
| subtract (Money ... $subtrahends) | |
Static Public Member Functions | |
| static | avg (self $first, self ... $collection) |
| static | max (self $first, self ... $collection) |
| static | min (self $first, self ... $collection) |
| static | registerCalculator ($calculator) |
| static | sum (self $first, self ... $collection) |
Data Fields | |
| const | ROUND_DOWN = 6 |
| const | ROUND_HALF_DOWN = PHP_ROUND_HALF_DOWN |
| const | ROUND_HALF_EVEN = PHP_ROUND_HALF_EVEN |
| const | ROUND_HALF_NEGATIVE_INFINITY = 8 |
| const | ROUND_HALF_ODD = PHP_ROUND_HALF_ODD |
| const | ROUND_HALF_POSITIVE_INFINITY = 7 |
| const | ROUND_HALF_UP = PHP_ROUND_HALF_UP |
| const | ROUND_UP = 5 |
| Money\Money::__construct | ( | $amount, | |
| Currency | $currency | ||
| ) |
| int | string | $amount | Amount, expressed in the smallest units of $currency (eg cents) |
| Currency | $currency |
Definition at line 74 of file Money.php.
References Money\Number\fromString().
| Money\Money::add | ( | Money ... | $addends | ) |
| Money\Money::allocate | ( | array | $ratios | ) |
| Money\Money::allocateTo | ( | $n | ) |
|
static |
| Money\Money::compare | ( | Money | $other | ) |
| Money\Money::divide | ( | $divisor, | |
$roundingMode = self::ROUND_HALF_UP |
|||
| ) |
Returns a new Money object that represents the divided value by the given factor.
| float | int | string | $divisor | |
| int | $roundingMode |
Definition at line 337 of file Money.php.
References Money\Number\fromNumber().
| Money\Money::equals | ( | Money | $other | ) |
| Money\Money::getAmount | ( | ) |
Returns the value represented by this object.
Definition at line 206 of file Money.php.
Referenced by Money\Formatter\DecimalMoneyFormatter\format(), Money\Formatter\IntlMoneyFormatter\format(), Money\Formatter\IntlLocalizedDecimalFormatter\format(), and Money\Formatter\BitcoinMoneyFormatter\format().
| Money\Money::getCurrency | ( | ) |
Returns the currency of this object.
Definition at line 216 of file Money.php.
Referenced by Money\Converter\convert(), Money\Formatter\DecimalMoneyFormatter\format(), Money\Formatter\IntlMoneyFormatter\format(), Money\Formatter\AggregateMoneyFormatter\format(), Money\Formatter\IntlLocalizedDecimalFormatter\format(), Money\Formatter\BitcoinMoneyFormatter\format(), and Omnipay\Common\Message\AbstractRequest\setMoney().
| Money\Money::greaterThan | ( | Money | $other | ) |
| Money\Money::greaterThanOrEqual | ( | Money | $other | ) |
| Money\Money::isNegative | ( | ) |
| Money\Money::isPositive | ( | ) |
| Money\Money::isSameCurrency | ( | Money | $other | ) |
| Money\Money::isZero | ( | ) |
Checks if the value represented by this object is zero.
Definition at line 497 of file Money.php.
Referenced by Money\Money\ratioOf().
| Money\Money::lessThan | ( | Money | $other | ) |
| Money\Money::lessThanOrEqual | ( | Money | $other | ) |
|
static |
|
static |
| Money\Money::mod | ( | Money | $divisor | ) |
| Money\Money::multiply | ( | $multiplier, | |
$roundingMode = self::ROUND_HALF_UP |
|||
| ) |
Returns a new Money object that represents the multiplied value by the given factor.
| float | int | string | $multiplier | |
| int | $roundingMode |
Definition at line 318 of file Money.php.
Referenced by Money\Converter\convert().
| Money\Money::ratioOf | ( | Money | $money | ) |
| Money | $money |
Definition at line 446 of file Money.php.
References Money\Money\isZero().
|
static |
| Money\Money::subtract | ( | Money ... | $subtrahends | ) |
|
static |
| const Money\Money::ROUND_HALF_DOWN = PHP_ROUND_HALF_DOWN |
Definition at line 22 of file Money.php.
Referenced by Money\Calculator\PhpCalculator\round(), Money\Calculator\BcMathCalculator\round(), and Money\Calculator\GmpCalculator\round().
| const Money\Money::ROUND_HALF_EVEN = PHP_ROUND_HALF_EVEN |
Definition at line 24 of file Money.php.
Referenced by Money\Calculator\BcMathCalculator\round(), and Money\Calculator\GmpCalculator\round().
| const Money\Money::ROUND_HALF_NEGATIVE_INFINITY = 8 |
Definition at line 34 of file Money.php.
Referenced by Money\Calculator\PhpCalculator\round(), Money\Calculator\BcMathCalculator\round(), and Money\Calculator\GmpCalculator\round().
| const Money\Money::ROUND_HALF_ODD = PHP_ROUND_HALF_ODD |
Definition at line 26 of file Money.php.
Referenced by Money\Calculator\BcMathCalculator\round(), and Money\Calculator\GmpCalculator\round().
| const Money\Money::ROUND_HALF_POSITIVE_INFINITY = 7 |
Definition at line 32 of file Money.php.
Referenced by Money\Calculator\PhpCalculator\round(), Money\Calculator\BcMathCalculator\round(), and Money\Calculator\GmpCalculator\round().
| const Money\Money::ROUND_HALF_UP = PHP_ROUND_HALF_UP |
Definition at line 20 of file Money.php.
Referenced by Money\Calculator\PhpCalculator\round(), Money\Calculator\BcMathCalculator\round(), and Money\Calculator\GmpCalculator\round().