1 | <?php |
||
22 | class NumberField extends Field |
||
23 | { |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | const PKNumberStyleDecimal = 'PKNumberStyleDecimal'; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | const PKNumberStylePercent = 'PKNumberStylePercent'; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | const PKNumberStyleScientific = 'PKNumberStyleScientific'; |
||
38 | |||
39 | /** |
||
40 | * ISO 4217 |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $currencyCode = null; |
||
45 | |||
46 | /** |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $numberStyle = null; |
||
50 | |||
51 | /** |
||
52 | * NumberField constructor. |
||
53 | * @param $key |
||
54 | * @param $value |
||
55 | * @throws InvalidArgumentException |
||
56 | */ |
||
57 | public function __construct($key, $value) |
||
65 | |||
66 | /** |
||
67 | * @return array |
||
68 | */ |
||
69 | public function toArray() |
||
81 | |||
82 | /** |
||
83 | * @param string $currencyCode an ISO 4217 currency code |
||
84 | * |
||
85 | * @return $this |
||
86 | */ |
||
87 | public function setCurrencyCode($currencyCode) |
||
93 | |||
94 | /** |
||
95 | * @return string |
||
96 | */ |
||
97 | public function getCurrencyCode() |
||
101 | |||
102 | /** |
||
103 | * @param string $numberStyle |
||
104 | * |
||
105 | * @return $this |
||
106 | */ |
||
107 | public function setNumberStyle($numberStyle) |
||
113 | |||
114 | /** |
||
115 | * @return string |
||
116 | */ |
||
117 | public function getNumberStyle() |
||
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | * |
||
125 | * @return int|float |
||
126 | */ |
||
127 | public function getValue() |
||
132 | } |