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 | 993 | public function __construct() |
|
24 | |||
25 | /** |
||
26 | * @return NumberFormat |
||
27 | */ |
||
28 | 993 | public function clear() |
|
39 | |||
40 | /** |
||
41 | * @return boolean |
||
42 | */ |
||
43 | 13 | public function hasPattern() |
|
47 | |||
48 | /** |
||
49 | * @return string |
||
50 | */ |
||
51 | 370 | public function getPattern() |
|
55 | |||
56 | /** |
||
57 | * @param string $value |
||
58 | * @return NumberFormat |
||
59 | */ |
||
60 | 991 | public function setPattern($value) |
|
66 | |||
67 | /** |
||
68 | * @return boolean |
||
69 | */ |
||
70 | 264 | public function hasNationalPrefixOptionalWhenFormatting() |
|
74 | |||
75 | /** |
||
76 | * @return boolean |
||
77 | */ |
||
78 | 985 | public function getNationalPrefixOptionalWhenFormatting() |
|
79 | { |
||
80 | 985 | return $this->nationalPrefixOptionalWhenFormatting; |
|
81 | 985 | } |
|
82 | |||
83 | /** |
||
84 | * @param boolean $nationalPrefixOptionalWhenFormatting |
||
85 | */ |
||
86 | 16 | public function setNationalPrefixOptionalWhenFormatting($nationalPrefixOptionalWhenFormatting) |
|
87 | { |
||
88 | 16 | $this->nationalPrefixOptionalWhenFormatting = $nationalPrefixOptionalWhenFormatting; |
|
89 | } |
||
90 | |||
91 | /** |
||
92 | * @return boolean |
||
93 | */ |
||
94 | 341 | public function hasFormat() |
|
98 | |||
99 | /** |
||
100 | * @return string |
||
101 | */ |
||
102 | public function getFormat() |
||
106 | |||
107 | 989 | /** |
|
108 | * @param string $value |
||
109 | * @return NumberFormat |
||
110 | */ |
||
111 | public function setFormat($value) |
||
112 | { |
||
113 | 199 | $this->format = $value; |
|
114 | |||
115 | 199 | return $this; |
|
116 | } |
||
117 | |||
118 | /** |
||
119 | * @return string |
||
120 | */ |
||
121 | 170 | public function leadingDigitPatterns() |
|
125 | |||
126 | /** |
||
127 | * @return int |
||
128 | */ |
||
129 | public function leadingDigitsPatternSize() |
||
133 | |||
134 | /** |
||
135 | * @param int $index |
||
136 | * @return string |
||
137 | */ |
||
138 | public function getLeadingDigitsPattern($index) |
||
142 | |||
143 | 684 | /** |
|
144 | * @param string $value |
||
145 | * @return NumberFormat |
||
146 | */ |
||
147 | public function addLeadingDigitsPattern($value) |
||
148 | { |
||
149 | 211 | $this->leadingDigitsPattern[] = $value; |
|
150 | |||
151 | 211 | return $this; |
|
152 | } |
||
153 | |||
154 | /** |
||
155 | * @return boolean |
||
156 | */ |
||
157 | 366 | public function hasNationalPrefixFormattingRule() |
|
161 | |||
162 | /** |
||
163 | * @return string |
||
164 | */ |
||
165 | public function getNationalPrefixFormattingRule() |
||
169 | |||
170 | 985 | /** |
|
171 | * @param string $value |
||
172 | * @return NumberFormat |
||
173 | */ |
||
174 | public function setNationalPrefixFormattingRule($value) |
||
175 | { |
||
176 | 2 | $this->nationalPrefixFormattingRule = $value; |
|
177 | |||
178 | 2 | return $this; |
|
179 | } |
||
180 | 2 | ||
181 | /** |
||
182 | * @return NumberFormat |
||
183 | */ |
||
184 | public function clearNationalPrefixFormattingRule() |
||
185 | { |
||
186 | 211 | $this->nationalPrefixFormattingRule = null; |
|
187 | |||
188 | 211 | return $this; |
|
189 | } |
||
190 | |||
191 | /** |
||
192 | * @return boolean |
||
193 | */ |
||
194 | 213 | public function hasDomesticCarrierCodeFormattingRule() |
|
198 | |||
199 | /** |
||
200 | * @return string |
||
201 | */ |
||
202 | public function getDomesticCarrierCodeFormattingRule() |
||
206 | |||
207 | 985 | /** |
|
208 | * @param string $value |
||
209 | * @return NumberFormat |
||
210 | */ |
||
211 | public function setDomesticCarrierCodeFormattingRule($value) |
||
212 | { |
||
217 | 13 | ||
218 | /** |
||
219 | 13 | * @param NumberFormat $other |
|
220 | 13 | * @return NumberFormat |
|
221 | */ |
||
222 | 13 | public function mergeFrom(NumberFormat $other) |
|
246 | 198 | ||
247 | /** |
||
248 | 198 | * @return array |
|
249 | 198 | */ |
|
250 | public function toArray() |
||
272 | 975 | ||
273 | 975 | /** |
|
274 | * @param array $input |
||
275 | 975 | */ |
|
276 | 975 | public function fromArray(array $input) |
|
295 | } |
||
296 |