Completed
Pull Request — master (#131)
by
unknown
15:54
created

PhoneMetadata::setPreferredExtnPrefix()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
rs 9.4285
ccs 3
cts 3
cp 1
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace libphonenumber;
4
5
class PhoneMetadata
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $id = null;
11
    /**
12
     * @var int
13
     */
14
    protected $countryCode = null;
15
    protected $leadingDigits = null;
16
    protected $internationalPrefix = null;
17
    protected $preferredInternationalPrefix = null;
18
    protected $nationalPrefixForParsing = null;
19
    protected $nationalPrefixTransformRule = null;
20
    protected $nationalPrefix = null;
21
    protected $preferredExtnPrefix = null;
22
    protected $mainCountryForCode = false;
23
    protected $leadingZeroPossible = false;
24
    protected $mobileNumberPortableRegion = false;
25
    protected $generalDesc = null;
26
    /**
27
     * @var PhoneNumberDesc
28
     */
29
    protected $mobile = null;
30
    protected $premiumRate = null;
31
    protected $fixedLine = null;
32
    protected $sameMobileAndFixedLinePattern = false;
33
    protected $numberFormat = array();
34
    protected $tollFree = null;
35
    protected $sharedCost = null;
36
    protected $personalNumber;
37
    protected $voip;
38
    protected $pager;
39
    protected $uan;
40
    protected $emergency;
41
    protected $voicemail;
42
    /**
43
     * @var PhoneNumberDesc
44
     */
45
    protected $short_code;
46
    /**
47
     * @var PhoneNumberDesc
48
     */
49
    protected $standard_rate;
50
    /**
51
     * @var PhoneNumberDesc
52
     */
53
    protected $carrierSpecific;
54
    /**
55
     * @var PhoneNumberDesc
56
     */
57
    protected $noInternationalDialling = null;
58
    /**
59
     *
60
     * @var NumberFormat[]
61
     */
62
    protected $intlNumberFormat = array();
63
64
    /**
65
     * @return boolean
66
     */
67
    public function hasId()
68
    {
69
        return isset($this->id);
70
    }
71
72
    /**
73
     * @return boolean
74
     */
75
    public function hasCountryCode()
76
    {
77
        return isset($this->countryCode);
78
    }
79
80
    public function hasInternationalPrefix()
81
    {
82
        return isset($this->internationalPrefix);
83
    }
84
85
    public function hasMainCountryForCode()
86
    {
87
        return isset($this->mainCountryForCode);
88
    }
89
90 2
    public function isMainCountryForCode()
91
    {
92 2
        return $this->mainCountryForCode;
93
    }
94
95
    public function getMainCountryForCode()
96
    {
97
        return $this->mainCountryForCode;
98
    }
99
100 760
    public function setMainCountryForCode($value)
101
    {
102 760
        $this->mainCountryForCode = $value;
103 760
        return $this;
104
    }
105
106
    public function hasLeadingZeroPossible()
107
    {
108
        return isset($this->leadingZeroPossible);
109
    }
110
111
    public function hasMobileNumberPortableRegion()
112
    {
113
        return isset($this->mobileNumberPortableRegion);
114
    }
115
116 1
    public function hasSameMobileAndFixedLinePattern()
117
    {
118 1
        return isset($this->sameMobileAndFixedLinePattern);
119
    }
120
121
    public function numberFormatSize()
122
    {
123
        return count($this->numberFormat);
124
    }
125
126
    /**
127
     * @param int $index
128
     * @return NumberFormat
129
     */
130 1
    public function getNumberFormat($index)
131
    {
132 1
        return $this->numberFormat[$index];
133
    }
134
135
    public function intlNumberFormatSize()
136
    {
137
        return count($this->intlNumberFormat);
138
    }
139
140 4
    public function getIntlNumberFormat($index)
141
    {
142 4
        return $this->intlNumberFormat[$index];
143
    }
144
145 7
    public function clearIntlNumberFormat()
146
    {
147 7
        $this->intlNumberFormat = array();
148 7
        return $this;
149
    }
150
151
    public function toArray()
152
    {
153
        $output = array();
154
155
        if ($this->hasGeneralDesc()) {
156
            $output['generalDesc'] = $this->getGeneralDesc()->toArray();
157
        }
158
159
        if ($this->hasFixedLine()) {
160
            $output['fixedLine'] = $this->getFixedLine()->toArray();
161
        }
162
163
        if ($this->hasMobile()) {
164
            $output['mobile'] = $this->getMobile()->toArray();
165
        }
166
167
        if ($this->hasTollFree()) {
168
            $output['tollFree'] = $this->getTollFree()->toArray();
169
        }
170
171
        if ($this->hasPremiumRate()) {
172
            $output['premiumRate'] = $this->getPremiumRate()->toArray();
173
        }
174
175
        if ($this->hasPremiumRate()) {
176
            $output['premiumRate'] = $this->getPremiumRate()->toArray();
177
        }
178
179
        if ($this->hasSharedCost()) {
180
            $output['sharedCost'] = $this->getSharedCost()->toArray();
181
        }
182
183
        if ($this->hasPersonalNumber()) {
184
            $output['personalNumber'] = $this->getPersonalNumber()->toArray();
185
        }
186
187
        if ($this->hasVoip()) {
188
            $output['voip'] = $this->getVoip()->toArray();
189
        }
190
191
        if ($this->hasPager()) {
192
            $output['pager'] = $this->getPager()->toArray();
193
        }
194
195
        if ($this->hasUan()) {
196
            $output['uan'] = $this->getUan()->toArray();
197
        }
198
199
        if ($this->hasEmergency()) {
200
            $output['emergency'] = $this->getEmergency()->toArray();
201
        }
202
203
        if ($this->hasVoicemail()) {
204
            $output['voicemail'] = $this->getVoicemail()->toArray();
205
        }
206
207
        if ($this->hasShortCode()) {
208
            $output['shortCode'] = $this->getShortCode()->toArray();
209
        }
210
211
        if ($this->hasStandardRate()) {
212
            $output['standardRate'] = $this->getStandardRate()->toArray();
213
        }
214
215
        if ($this->hasCarrierSpecific()) {
216
            $output['carrierSpecific'] = $this->getCarrierSpecific()->toArray();
217
        }
218
219
        if ($this->hasNoInternationalDialling()) {
220
            $output['noInternationalDialling'] = $this->getNoInternationalDialling()->toArray();
221
        }
222
223
        $output['id'] = $this->getId();
224
        $output['countryCode'] = $this->getCountryCode();
225
        $output['internationalPrefix'] = $this->getInternationalPrefix();
226
227
        if ($this->hasPreferredInternationalPrefix()) {
228
            $output['preferredInternationalPrefix'] = $this->getPreferredInternationalPrefix();
229
        }
230
231
        if ($this->hasNationalPrefix()) {
232
            $output['nationalPrefix'] = $this->getNationalPrefix();
233
        }
234
235
        if ($this->hasPreferredExtnPrefix()) {
236
            $output['preferredExtnPrefix'] = $this->getPreferredExtnPrefix();
237
        }
238
239
        if ($this->hasNationalPrefixForParsing()) {
240
            $output['nationalPrefixForParsing'] = $this->getNationalPrefixForParsing();
241
        }
242
243
        if ($this->hasNationalPrefixTransformRule()) {
244
            $output['nationalPrefixTransformRule'] = $this->getNationalPrefixTransformRule();
245
        }
246
247
        $output['sameMobileAndFixedLinePattern'] = $this->isSameMobileAndFixedLinePattern();
248
249
        $output['numberFormat'] = array();
250
        foreach ($this->numberFormats() as $numberFormat) {
251
            $output['numberFormat'][] = $numberFormat->toArray();
252
        }
253
254
        $output['intlNumberFormat'] = array();
255
        foreach ($this->intlNumberFormats() as $intlNumberFormat) {
256
            $output['intlNumberFormat'][] = $intlNumberFormat->toArray();
257
        }
258
259
        $output['mainCountryForCode'] = $this->getMainCountryForCode();
260
261
        if ($this->hasLeadingDigits()) {
262
            $output['leadingDigits'] = $this->getLeadingDigits();
263
        }
264
265
        $output['leadingZeroPossible'] = $this->isLeadingZeroPossible();
266
267
        $output['mobileNumberPortableRegion'] = $this->isMobileNumberPortableRegion();
268
269
        return $output;
270
    }
271
272
    public function hasGeneralDesc()
273
    {
274
        return isset($this->generalDesc);
275
    }
276
277
    /**
278
     * @return PhoneNumberDesc
279
     */
280 293
    public function getGeneralDesc()
281
    {
282 293
        return $this->generalDesc;
283
    }
284
285 765
    public function setGeneralDesc(PhoneNumberDesc $value)
286
    {
287 765
        $this->generalDesc = $value;
288 765
        return $this;
289 765
    }
290
291
    public function hasFixedLine()
292
    {
293
        return isset($this->fixedLine);
294
    }
295
296
    /**
297
     * @return PhoneNumberDesc
298
     */
299 412
    public function getFixedLine()
300
    {
301 412
        return $this->fixedLine;
302
    }
303
304 517
    public function setFixedLine(PhoneNumberDesc $value)
305
    {
306 517
        $this->fixedLine = $value;
307 517
        return $this;
308 517
    }
309
310
    public function hasMobile()
311
    {
312
        return isset($this->mobile);
313
    }
314
315
    /**
316
     * @return PhoneNumberDesc
317
     */
318 63
    public function getMobile()
319
    {
320 63
        return $this->mobile;
321
    }
322
323 517
    public function setMobile(PhoneNumberDesc $value)
324
    {
325 517
        $this->mobile = $value;
326 517
        return $this;
327 517
    }
328
329
    public function hasTollFree()
330
    {
331
        return isset($this->tollFree);
332
    }
333
334
    /**
335
     * @return PhoneNumberDesc
336
     */
337 591
    public function getTollFree()
338
    {
339 591
        return $this->tollFree;
340
    }
341
342 762
    public function setTollFree(PhoneNumberDesc $value)
343
    {
344 762
        $this->tollFree = $value;
345 762
        return $this;
346 762
    }
347
348
    public function hasPremiumRate()
349
    {
350
        return isset($this->premiumRate);
351
    }
352
353
    /**
354
     * @return PhoneNumberDesc
355
     */
356 708
    public function getPremiumRate()
357
    {
358 708
        return $this->premiumRate;
359
    }
360
361 762
    public function setPremiumRate(PhoneNumberDesc $value)
362
    {
363 762
        $this->premiumRate = $value;
364 762
        return $this;
365 762
    }
366
367
    public function hasSharedCost()
368
    {
369
        return isset($this->sharedCost);
370
    }
371
372
    /**
373
     * @return PhoneNumberDesc
374
     */
375 261
    public function getSharedCost()
376
    {
377 261
        return $this->sharedCost;
378
    }
379
380 517
    public function setSharedCost(PhoneNumberDesc $value)
381
    {
382 517
        $this->sharedCost = $value;
383 517
        return $this;
384 517
    }
385
386
    public function hasPersonalNumber()
387
    {
388
        return isset($this->personalNumber);
389
    }
390
391
    /**
392
     * @return PhoneNumberDesc
393
     */
394 248
    public function getPersonalNumber()
395
    {
396 248
        return $this->personalNumber;
397
    }
398
399 517
    public function setPersonalNumber(PhoneNumberDesc $value)
400
    {
401 517
        $this->personalNumber = $value;
402 517
        return $this;
403 517
    }
404
405
    public function hasVoip()
406
    {
407
        return isset($this->voip);
408
    }
409
410
    /**
411
     * @return PhoneNumberDesc
412
     */
413 239
    public function getVoip()
414
    {
415 239
        return $this->voip;
416
    }
417
418 517
    public function setVoip(PhoneNumberDesc $value)
419
    {
420 517
        $this->voip = $value;
421 517
        return $this;
422 517
    }
423
424
    public function hasPager()
425
    {
426
        return isset($this->pager);
427
    }
428
429
    /**
430
     * @return PhoneNumberDesc
431
     */
432 285
    public function getPager()
433
    {
434 285
        return $this->pager;
435
    }
436
437 517
    public function setPager(PhoneNumberDesc $value)
438
    {
439 517
        $this->pager = $value;
440 517
        return $this;
441 517
    }
442
443
    public function hasUan()
444
    {
445
        return isset($this->uan);
446
    }
447
448
    /**
449
     * @return PhoneNumberDesc
450
     */
451 255
    public function getUan()
452
    {
453 255
        return $this->uan;
454
    }
455
456 517
    public function setUan(PhoneNumberDesc $value)
457
    {
458 517
        $this->uan = $value;
459 517
        return $this;
460 517
    }
461
462 5
    public function hasEmergency()
463
    {
464 5
        return isset($this->emergency);
465
    }
466
467
    /**
468
     * @return PhoneNumberDesc
469
     */
470 4
    public function getEmergency()
471
    {
472 4
        return $this->emergency;
473
    }
474
475 250
    public function setEmergency(PhoneNumberDesc $value)
476
    {
477 250
        $this->emergency = $value;
478 250
        return $this;
479 250
    }
480
481
    public function hasVoicemail()
482
    {
483
        return isset($this->voicemail);
484
    }
485
486
    /**
487
     * @return PhoneNumberDesc
488
     */
489 291
    public function getVoicemail()
490
    {
491 291
        return $this->voicemail;
492
    }
493
494 517
    public function setVoicemail(PhoneNumberDesc $value)
495
    {
496 517
        $this->voicemail = $value;
497 517
        return $this;
498 517
    }
499
500
    public function hasShortCode()
501
    {
502
        return isset($this->short_code);
503
    }
504
505 6
    public function getShortCode()
506
    {
507 6
        return $this->short_code;
508
    }
509
510 250
    public function setShortCode(PhoneNumberDesc $value)
511
    {
512 250
        $this->short_code = $value;
513 250
        return $this;
514 250
    }
515
516
    public function hasStandardRate()
517
    {
518
        return isset($this->standard_rate);
519
    }
520
521 507
    public function getStandardRate()
522
    {
523 507
        return $this->standard_rate;
524
    }
525
526 250
    public function setStandardRate(PhoneNumberDesc $value)
527
    {
528 250
        $this->standard_rate = $value;
529 250
        return $this;
530 250
    }
531
532
    public function hasCarrierSpecific()
533
    {
534
        return isset($this->carrierSpecific);
535
    }
536
537 210
    public function getCarrierSpecific()
538
    {
539 210
        return $this->carrierSpecific;
540
    }
541
542 250
    public function setCarrierSpecific(PhoneNumberDesc $value)
543
    {
544 250
        $this->carrierSpecific = $value;
545 250
        return $this;
546 250
    }
547
548
    public function hasNoInternationalDialling()
549
    {
550
        return isset($this->noInternationalDialling);
551
    }
552
553 215
    public function getNoInternationalDialling()
554
    {
555 215
        return $this->noInternationalDialling;
556
    }
557
558 517
    public function setNoInternationalDialling(PhoneNumberDesc $value)
559
    {
560 517
        $this->noInternationalDialling = $value;
561 517
        return $this;
562 517
    }
563
564
    /**
565
     * @return string
566
     */
567 12
    public function getId()
568
    {
569 12
        return $this->id;
570
    }
571
572
    /**
573
     * @param string $value
574
     * @return PhoneMetadata
575
     */
576 766
    public function setId($value)
577
    {
578 766
        $this->id = $value;
579 766
        return $this;
580
    }
581
582
    /**
583
     * @return int
584
     */
585 14
    public function getCountryCode()
586
    {
587 14
        return $this->countryCode;
588
    }
589
590
    /**
591
     * @param int $value
592
     * @return PhoneMetadata
593
     */
594 766
    public function setCountryCode($value)
595
    {
596 766
        $this->countryCode = $value;
597 766
        return $this;
598
    }
599
600 2441
    public function getInternationalPrefix()
601
    {
602 2441
        return $this->internationalPrefix;
603
    }
604
605 766
    public function setInternationalPrefix($value)
606
    {
607 766
        $this->internationalPrefix = $value;
608 766
        return $this;
609
    }
610
611 1
    public function hasPreferredInternationalPrefix()
612
    {
613 1
        return isset($this->preferredInternationalPrefix);
614
    }
615
616 3
    public function getPreferredInternationalPrefix()
617
    {
618 3
        return $this->preferredInternationalPrefix;
619
    }
620
621 58
    public function setPreferredInternationalPrefix($value)
622
    {
623 58
        $this->preferredInternationalPrefix = $value;
624 58
        return $this;
625
    }
626
627 1
    public function hasNationalPrefix()
628
    {
629 1
        return isset($this->nationalPrefix);
630
    }
631
632 4
    public function getNationalPrefix()
633
    {
634 4
        return $this->nationalPrefix;
635
    }
636
637 3
    public function setNationalPrefix($value)
638
    {
639 3
        $this->nationalPrefix = $value;
640 3
        return $this;
641
    }
642
643
    public function hasPreferredExtnPrefix()
644
    {
645
        return isset($this->preferredExtnPrefix);
646
    }
647
648 2
    public function getPreferredExtnPrefix()
649
    {
650 2
        return $this->preferredExtnPrefix;
651
    }
652
653 78
    public function setPreferredExtnPrefix($value)
654
    {
655 78
        $this->preferredExtnPrefix = $value;
656 78
        return $this;
657
    }
658
659 3
    public function hasNationalPrefixForParsing()
660
    {
661 3
        return isset($this->nationalPrefixForParsing);
662
    }
663
664 2170
    public function getNationalPrefixForParsing()
665
    {
666 2170
        return $this->nationalPrefixForParsing;
667
    }
668
669 319
    public function setNationalPrefixForParsing($value)
670
    {
671 319
        $this->nationalPrefixForParsing = $value;
672 319
        return $this;
673
    }
674
675
    public function hasNationalPrefixTransformRule()
676
    {
677
        return isset($this->nationalPrefixTransformRule);
678
    }
679
680 50
    public function getNationalPrefixTransformRule()
681
    {
682 50
        return $this->nationalPrefixTransformRule;
683
    }
684
685 29
    public function setNationalPrefixTransformRule($value)
686
    {
687 29
        $this->nationalPrefixTransformRule = $value;
688 29
        return $this;
689
    }
690
691 59
    public function isSameMobileAndFixedLinePattern()
692
    {
693 59
        return $this->sameMobileAndFixedLinePattern;
694
    }
695
696 2
    public function setSameMobileAndFixedLinePattern($value)
697
    {
698 2
        $this->sameMobileAndFixedLinePattern = $value;
699 2
        return $this;
700
    }
701
702
    /**
703
     * @return NumberFormat[]
704
     */
705 22
    public function numberFormats()
706
    {
707 22
        return $this->numberFormat;
708
    }
709
710 23
    public function intlNumberFormats()
711
    {
712 23
        return $this->intlNumberFormat;
713
    }
714
715
    /**
716
     * @return bool
717
     */
718 30
    public function hasLeadingDigits()
719
    {
720 30
        return isset($this->leadingDigits);
721
    }
722
723 8
    public function getLeadingDigits()
724
    {
725 8
        return $this->leadingDigits;
726
    }
727
728 30
    public function setLeadingDigits($value)
729
    {
730 30
        $this->leadingDigits = $value;
731 30
        return $this;
732
    }
733
734 2
    public function isLeadingZeroPossible()
735
    {
736 2
        return $this->leadingZeroPossible;
737
    }
738
739 760
    public function setLeadingZeroPossible($value)
740
    {
741 760
        $this->leadingZeroPossible = $value;
742 760
        return $this;
743
    }
744
745 4
    public function isMobileNumberPortableRegion()
746
    {
747 4
        return $this->mobileNumberPortableRegion;
748
    }
749
750 760
    public function setMobileNumberPortableRegion($value)
751
    {
752 760
        $this->mobileNumberPortableRegion = $value;
753 760
        return $this;
754
    }
755
756
    /**
757
     * @param array $input
758
     * @return PhoneMetadata
759
     */
760 759
    public function fromArray(array $input)
761
    {
762 759
        if (isset($input['generalDesc'])) {
763
            $desc = new PhoneNumberDesc();
764
            $this->setGeneralDesc($desc->fromArray($input['generalDesc']));
765
        }
766
767 759
        if (isset($input['fixedLine'])) {
768
            $desc = new PhoneNumberDesc();
769
            $this->setFixedLine($desc->fromArray($input['fixedLine']));
770
        }
771
772 759
        if (isset($input['mobile'])) {
773
            $desc = new PhoneNumberDesc();
774
            $this->setMobile($desc->fromArray($input['mobile']));
775
        }
776
777 759
        if (isset($input['tollFree'])) {
778
            $desc = new PhoneNumberDesc();
779
            $this->setTollFree($desc->fromArray($input['tollFree']));
780
        }
781
782 759
        if (isset($input['premiumRate'])) {
783
            $desc = new PhoneNumberDesc();
784
            $this->setPremiumRate($desc->fromArray($input['premiumRate']));
785
        }
786
787 759
        if (isset($input['sharedCost'])) {
788
            $desc = new PhoneNumberDesc();
789
            $this->setSharedCost($desc->fromArray($input['sharedCost']));
790
        }
791
792 759
        if (isset($input['personalNumber'])) {
793
            $desc = new PhoneNumberDesc();
794
            $this->setPersonalNumber($desc->fromArray($input['personalNumber']));
795
        }
796
797 759
        if (isset($input['voip'])) {
798
            $desc = new PhoneNumberDesc();
799
            $this->setVoip($desc->fromArray($input['voip']));
800
        }
801
802 759
        if (isset($input['pager'])) {
803
            $desc = new PhoneNumberDesc();
804
            $this->setPager($desc->fromArray($input['pager']));
805
        }
806
807 759
        if (isset($input['uan'])) {
808
            $desc = new PhoneNumberDesc();
809
            $this->setUan($desc->fromArray($input['uan']));
810
        }
811
812 759
        if (isset($input['emergency'])) {
813
            $desc = new PhoneNumberDesc();
814
            $this->setEmergency($desc->fromArray($input['emergency']));
815
        }
816
817 759
        if (isset($input['voicemail'])) {
818
            $desc = new PhoneNumberDesc();
819
            $this->setVoicemail($desc->fromArray($input['voicemail']));
820
        }
821
822 759
        if (isset($input['shortCode'])) {
823
            $desc = new PhoneNumberDesc();
824
            $this->setShortCode(($desc->fromArray($input['shortCode'])));
825
        }
826
827 759
        if (isset($input['standardRate'])) {
828
            $desc = new PhoneNumberDesc();
829
            $this->setStandardRate($desc->fromArray($input['standardRate']));
830
        }
831
832 759
        if (isset($input['carrierSpecific'])) {
833
            $desc = new PhoneNumberDesc();
834
            $this->setCarrierSpecific($desc->fromArray($input['carrierSpecific']));
835
        }
836
837 759
        if (isset($input['noInternationalDialling'])) {
838
            $desc = new PhoneNumberDesc();
839
            $this->setNoInternationalDialling($desc->fromArray($input['noInternationalDialling']));
840
        }
841
842
        $this->setId($input['id']);
843
        $this->setCountryCode($input['countryCode']);
844
        $this->setInternationalPrefix($input['internationalPrefix']);
845
846 759
        if (isset($input['preferredInternationalPrefix'])) {
847
            $this->setPreferredInternationalPrefix($input['preferredInternationalPrefix']);
848
        }
849 759
        if (isset($input['nationalPrefix'])) {
850
            $this->setNationalPrefix($input['nationalPrefix']);
851
        }
852 759
        if (isset($input['nationalPrefix'])) {
853
            $this->setNationalPrefix($input['nationalPrefix']);
854
        }
855
856 759
        if (isset($input['preferredExtnPrefix'])) {
857
            $this->setPreferredExtnPrefix($input['preferredExtnPrefix']);
858
        }
859
860 759
        if (isset($input['nationalPrefixForParsing'])) {
861
            $this->setNationalPrefixForParsing($input['nationalPrefixForParsing']);
862
        }
863
864 759
        if (isset($input['nationalPrefixTransformRule'])) {
865
            $this->setNationalPrefixTransformRule($input['nationalPrefixTransformRule']);
866
        }
867
868 759
        foreach ($input['numberFormat'] as $numberFormatElt) {
869
            $numberFormat = new NumberFormat();
870
            $numberFormat->fromArray($numberFormatElt);
871
            $this->addNumberFormat($numberFormat);
872 300
        }
873
874 759
        foreach ($input['intlNumberFormat'] as $intlNumberFormatElt) {
875
            $numberFormat = new NumberFormat();
876
            $numberFormat->fromArray($intlNumberFormatElt);
877
            $this->addIntlNumberFormat($numberFormat);
878 713
        }
879
880
        $this->setMainCountryForCode($input['mainCountryForCode']);
881
882 759
        if (isset($input['leadingDigits'])) {
883
            $this->setLeadingDigits($input['leadingDigits']);
884
        }
885
886
        $this->setLeadingZeroPossible($input['leadingZeroPossible']);
887
888
        $this->setMobileNumberPortableRegion($input['mobileNumberPortableRegion']);
889
890 759
        return $this;
891 759
    }
892
893 130
    public function addNumberFormat(NumberFormat $value)
894
    {
895 130
        $this->numberFormat[] = $value;
896 130
        return $this;
897 130
    }
898
899 80
    public function addIntlNumberFormat(NumberFormat $value)
900
    {
901 80
        $this->intlNumberFormat[] = $value;
902 80
        return $this;
903 80
    }
904
}
905