PHP Class Dumplie\SharedKernel\Domain\Money\Price

Afficher le fichier Open project: dumplie/dumplie Class Usage Examples

Méthodes publiques

Méthode Description
__callStatic ( $method, $arguments ) : Price
__construct ( integer $amount, string $currency, integer $precision = self::DEFAULT_PRECISION )
add ( Price $addend ) : Price
amount ( ) : integer
currency ( ) : string
floatValue ( ) : float
fromInt ( integer $value, string $currency ) : Price
hasCurrency ( string $currency ) : boolean
hasSameCurrency ( Price $price ) : boolean
multiply ( integer $multiplier ) : Price
precision ( ) : integer

Method Details

__callStatic() public static méthode

public static __callStatic ( $method, $arguments ) : Price
$method
$arguments
Résultat Price

__construct() public méthode

public __construct ( integer $amount, string $currency, integer $precision = self::DEFAULT_PRECISION )
$amount integer Amount, expressed in the smallest units of $currency (eg cents)
$currency string
$precision integer used to calculate float value, 10000 cents / 100 = 100.00

add() public méthode

public add ( Price $addend ) : Price
$addend Price
Résultat Price

amount() public méthode

public amount ( ) : integer
Résultat integer

currency() public méthode

public currency ( ) : string
Résultat string

floatValue() public méthode

public floatValue ( ) : float
Résultat float

fromInt() public static méthode

public static fromInt ( integer $value, string $currency ) : Price
$value integer
$currency string
Résultat Price

hasCurrency() public méthode

public hasCurrency ( string $currency ) : boolean
$currency string
Résultat boolean

hasSameCurrency() public méthode

public hasSameCurrency ( Price $price ) : boolean
$price Price
Résultat boolean

multiply() public méthode

public multiply ( integer $multiplier ) : Price
$multiplier integer
Résultat Price

precision() public méthode

public precision ( ) : integer
Résultat integer