1 | <?php |
||
8 | class NumberFormat |
||
9 | { |
||
10 | protected $pattern = null; |
||
11 | protected $format = null; |
||
12 | protected $leadingDigitsPattern = array(); |
||
13 | protected $nationalPrefixFormattingRule = null; |
||
14 | /** |
||
15 | * @var bool |
||
16 | */ |
||
17 | protected $nationalPrefixOptionalWhenFormatting = false; |
||
18 | protected $domesticCarrierCodeFormattingRule = null; |
||
19 | |||
20 | 574 | public function __construct() |
|
21 | { |
||
22 | 574 | $this->clear(); |
|
23 | 574 | } |
|
24 | |||
25 | /** |
||
26 | * @return NumberFormat |
||
27 | */ |
||
28 | 574 | public function clear() |
|
39 | |||
40 | /** |
||
41 | * @return boolean |
||
42 | */ |
||
43 | 13 | public function hasPattern() |
|
47 | |||
48 | /** |
||
49 | * @return string |
||
50 | */ |
||
51 | 56 | public function getPattern() |
|
55 | |||
56 | /** |
||
57 | * @param string $value |
||
58 | * @return NumberFormat |
||
59 | */ |
||
60 | 572 | public function setPattern($value) |
|
66 | |||
67 | /** |
||
68 | * @return boolean |
||
69 | */ |
||
70 | 13 | public function isNationalPrefixOptionalWhenFormatting() |
|
74 | |||
75 | /** |
||
76 | * @param boolean $nationalPrefixOptionalWhenFormatting |
||
77 | */ |
||
78 | 566 | public function setNationalPrefixOptionalWhenFormatting($nationalPrefixOptionalWhenFormatting) |
|
82 | |||
83 | /** |
||
84 | * @return boolean |
||
85 | */ |
||
86 | 16 | public function hasFormat() |
|
90 | |||
91 | /** |
||
92 | * @return string |
||
93 | */ |
||
94 | 59 | public function getFormat() |
|
98 | |||
99 | /** |
||
100 | * @param string $value |
||
101 | * @return NumberFormat |
||
102 | */ |
||
103 | 570 | public function setFormat($value) |
|
109 | |||
110 | /** |
||
111 | * @return string |
||
112 | */ |
||
113 | 1 | public function leadingDigitPatterns() |
|
114 | { |
||
115 | 1 | return $this->leadingDigitsPattern; |
|
116 | } |
||
117 | |||
118 | /** |
||
119 | * @return int |
||
120 | */ |
||
121 | 54 | public function leadingDigitsPatternSize() |
|
122 | { |
||
123 | 54 | return count($this->leadingDigitsPattern); |
|
124 | } |
||
125 | |||
126 | /** |
||
127 | * @param int $index |
||
128 | * @return string |
||
129 | */ |
||
130 | 43 | public function getLeadingDigitsPattern($index) |
|
134 | |||
135 | /** |
||
136 | * @param string $value |
||
137 | * @return NumberFormat |
||
138 | */ |
||
139 | 414 | public function addLeadingDigitsPattern($value) |
|
145 | |||
146 | /** |
||
147 | * @return boolean |
||
148 | */ |
||
149 | 13 | public function hasNationalPrefixFormattingRule() |
|
153 | |||
154 | /** |
||
155 | * @return string |
||
156 | */ |
||
157 | 52 | public function getNationalPrefixFormattingRule() |
|
161 | |||
162 | /** |
||
163 | * @param string $value |
||
164 | * @return NumberFormat |
||
165 | */ |
||
166 | 566 | public function setNationalPrefixFormattingRule($value) |
|
172 | |||
173 | /** |
||
174 | * @return NumberFormat |
||
175 | */ |
||
176 | 2 | public function clearNationalPrefixFormattingRule() |
|
177 | { |
||
178 | 2 | $this->nationalPrefixFormattingRule = null; |
|
179 | |||
180 | 2 | return $this; |
|
181 | } |
||
182 | |||
183 | /** |
||
184 | * @return boolean |
||
185 | */ |
||
186 | 13 | public function hasDomesticCarrierCodeFormattingRule() |
|
190 | |||
191 | /** |
||
192 | * @return string |
||
193 | */ |
||
194 | 15 | public function getDomesticCarrierCodeFormattingRule() |
|
198 | |||
199 | /** |
||
200 | * @param string $value |
||
201 | * @return NumberFormat |
||
202 | */ |
||
203 | 566 | public function setDomesticCarrierCodeFormattingRule($value) |
|
209 | |||
210 | /** |
||
211 | * @param NumberFormat $other |
||
212 | * @return NumberFormat |
||
213 | */ |
||
214 | 13 | public function mergeFrom(NumberFormat $other) |
|
236 | |||
237 | /** |
||
238 | * @return array |
||
239 | */ |
||
240 | public function toArray() |
||
260 | |||
261 | /** |
||
262 | * @param array $input |
||
263 | */ |
||
264 | 556 | public function fromArray(array $input) |
|
281 | } |
||
282 |