Completed
Push — master ( 19dd1e...6471ae )
by Joshua
34:25 queued 15:24
created

PhoneMetadata::getLeadingDigits()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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