1 | <?php |
||
8 | class Money |
||
9 | { |
||
10 | /** |
||
11 | * @var float $amount |
||
12 | */ |
||
13 | private $amount; |
||
14 | |||
15 | /** |
||
16 | * @var Currency $currency |
||
17 | */ |
||
18 | private $currency; |
||
19 | |||
20 | /** |
||
21 | * @param float|integer $amount |
||
22 | * @param Currency|string $currency iso4217 currency |
||
23 | */ |
||
24 | 10 | public function __construct($amount, Currency $currency) |
|
29 | |||
30 | /** |
||
31 | * @return string |
||
32 | */ |
||
33 | 1 | public function __toString() |
|
41 | |||
42 | /** |
||
43 | * @param float $amount |
||
44 | * @return self |
||
45 | */ |
||
46 | 10 | public function setAmount($amount) |
|
52 | |||
53 | /** |
||
54 | * @return float |
||
55 | */ |
||
56 | 2 | public function getAmount() |
|
60 | |||
61 | /** |
||
62 | * @param string|null $locale if null, defaults to Locale::getDefault |
||
63 | * @return string |
||
64 | */ |
||
65 | 2 | public function getFormattedAmount($locale = null) |
|
78 | |||
79 | /** |
||
80 | * @return Currency |
||
81 | */ |
||
82 | 2 | public function getCurrency() |
|
86 | } |
||
87 |