Completed
Push — analysis-z4wVAw ( 7f865f )
by Joshua
21:35 queued 05:10
created

PhoneMetadata::getCarrierSpecific()   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
ccs 2
cts 2
cp 1
rs 10
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
    protected $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 866
    public function setId($value)
34
    {
35 866
        $this->id = $value;
36 866
        return $this;
37
    }
38
39
    /**
40
     * @var int
41
     */
42
    protected $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 2721
    public function getCountryCode()
56
    {
57 2721
        return $this->countryCode;
58
    }
59
60
    /**
61
     * @param int $value
62
     * @return PhoneMetadata
63
     */
64 866
    public function setCountryCode($value)
65
    {
66 866
        $this->countryCode = $value;
67 866
        return $this;
68
    }
69
70
    protected $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
    protected $internationalPrefix = null;
92
93
    public function hasInternationalPrefix()
94
    {
95
        return isset($this->internationalPrefix);
96
    }
97
98 2717
    public function getInternationalPrefix()
99
    {
100 2717
        return $this->internationalPrefix;
101
    }
102
103 866
    public function setInternationalPrefix($value)
104
    {
105 866
        $this->internationalPrefix = $value;
106 866
        return $this;
107
    }
108
109
    protected $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 60
    public function setPreferredInternationalPrefix($value)
122
    {
123 60
        $this->preferredInternationalPrefix = $value;
124 60
        return $this;
125
    }
126
127
    protected $nationalPrefixForParsing = null;
128
129
    public function hasNationalPrefixForParsing()
130
    {
131
        return isset($this->nationalPrefixForParsing);
132
    }
133
134 2728
    public function getNationalPrefixForParsing()
135
    {
136 2728
        return $this->nationalPrefixForParsing;
137
    }
138
139 401
    public function setNationalPrefixForParsing($value)
140
    {
141 401
        $this->nationalPrefixForParsing = $value;
142 401
        return $this;
143
    }
144
145
    protected $nationalPrefixTransformRule = null;
146
147
    public function hasNationalPrefixTransformRule()
148
    {
149
        return isset($this->nationalPrefixTransformRule);
150
    }
151
152 71
    public function getNationalPrefixTransformRule()
153
    {
154 71
        return $this->nationalPrefixTransformRule;
155
    }
156
157 28
    public function setNationalPrefixTransformRule($value)
158
    {
159 28
        $this->nationalPrefixTransformRule = $value;
160 28
        return $this;
161
    }
162
163
    protected $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 390
    public function setNationalPrefix($value)
176
    {
177 390
        $this->nationalPrefix = $value;
178 390
        return $this;
179
    }
180
181
    protected $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 84
    public function setPreferredExtnPrefix($value)
194
    {
195 84
        $this->preferredExtnPrefix = $value;
196 84
        return $this;
197
    }
198
199
    protected $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 866
    public function setMainCountryForCode($value)
217
    {
218 866
        $this->mainCountryForCode = $value;
219 866
        return $this;
220
    }
221
222
    protected $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 866
    public function setLeadingZeroPossible($value)
235
    {
236 866
        $this->leadingZeroPossible = $value;
237 866
        return $this;
238
    }
239
240
    protected $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 866
    public function setMobileNumberPortableRegion($value)
253
    {
254 866
        $this->mobileNumberPortableRegion = $value;
255 866
        return $this;
256
    }
257
258
    protected $generalDesc = null;
259
260
    public function hasGeneralDesc()
261
    {
262
        return isset($this->generalDesc);
263
    }
264
265
    /**
266
     * @return PhoneNumberDesc
267
     */
268 2769
    public function getGeneralDesc()
269
    {
270 2769
        return $this->generalDesc;
271
    }
272
273 867
    public function setGeneralDesc(PhoneNumberDesc $value)
274
    {
275 867
        $this->generalDesc = $value;
276 867
        return $this;
277
    }
278
279
    /**
280
     * @var PhoneNumberDesc
281
     */
282
    protected $mobile = null;
283
284
    public function hasMobile()
285
    {
286
        return isset($this->mobile);
287
    }
288
289
    /**
290
     * @return PhoneNumberDesc
291
     */
292 1129
    public function getMobile()
293
    {
294 1129
        return $this->mobile;
295
    }
296
297 866
    public function setMobile(PhoneNumberDesc $value)
298
    {
299 866
        $this->mobile = $value;
300 866
        return $this;
301
    }
302
303
    protected $premiumRate = null;
304
305
    public function hasPremiumRate()
306
    {
307
        return isset($this->premiumRate);
308
    }
309
310
    /**
311
     * @return PhoneNumberDesc
312
     */
313 2374
    public function getPremiumRate()
314
    {
315 2374
        return $this->premiumRate;
316
    }
317
318 866
    public function setPremiumRate(PhoneNumberDesc $value)
319
    {
320 866
        $this->premiumRate = $value;
321 866
        return $this;
322
    }
323
324
    protected $fixedLine = null;
325
326
    public function hasFixedLine()
327
    {
328
        return isset($this->fixedLine);
329
    }
330
331
    /**
332
     * @return PhoneNumberDesc
333
     */
334 1515
    public function getFixedLine()
335
    {
336 1515
        return $this->fixedLine;
337
    }
338
339 866
    public function setFixedLine(PhoneNumberDesc $value)
340
    {
341 866
        $this->fixedLine = $value;
342 866
        return $this;
343
    }
344
345
    protected $sameMobileAndFixedLinePattern = false;
346
347
    public function hasSameMobileAndFixedLinePattern()
348
    {
349
        return isset($this->sameMobileAndFixedLinePattern);
350
    }
351
352 1125
    public function isSameMobileAndFixedLinePattern()
353
    {
354 1125
        return $this->sameMobileAndFixedLinePattern;
355
    }
356
357
    public function setSameMobileAndFixedLinePattern($value)
358
    {
359
        $this->sameMobileAndFixedLinePattern = $value;
360
        return $this;
361
    }
362
363
    protected $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 556
    public function addNumberFormat(NumberFormat $value)
388
    {
389 556
        $this->numberFormat[] = $value;
390 556
        return $this;
391
    }
392
393
    protected $tollFree = null;
394
395
    public function hasTollFree()
396
    {
397
        return isset($this->tollFree);
398
    }
399
400
    /**
401
     * @return PhoneNumberDesc
402
     */
403 2149
    public function getTollFree()
404
    {
405 2149
        return $this->tollFree;
406
    }
407
408 866
    public function setTollFree(PhoneNumberDesc $value)
409
    {
410 866
        $this->tollFree = $value;
411 866
        return $this;
412
    }
413
414
    protected $sharedCost = null;
415
416
    public function hasSharedCost()
417
    {
418
        return isset($this->sharedCost);
419
    }
420
421
    /**
422
     * @return PhoneNumberDesc
423
     */
424 1603
    public function getSharedCost()
425
    {
426 1603
        return $this->sharedCost;
427
    }
428
429 866
    public function setSharedCost(PhoneNumberDesc $value)
430
    {
431 866
        $this->sharedCost = $value;
432 866
        return $this;
433
    }
434
435
    protected $personalNumber;
436
437
    public function hasPersonalNumber()
438
    {
439
        return isset($this->personalNumber);
440
    }
441
442
    /**
443
     * @return PhoneNumberDesc
444
     */
445 1461
    public function getPersonalNumber()
446
    {
447 1461
        return $this->personalNumber;
448
    }
449
450 866
    public function setPersonalNumber(PhoneNumberDesc $value)
451
    {
452 866
        $this->personalNumber = $value;
453 866
        return $this;
454
    }
455
456
    protected $voip;
457
458
    public function hasVoip()
459
    {
460
        return isset($this->voip);
461
    }
462
463
    /**
464
     * @return PhoneNumberDesc
465
     */
466 1524
    public function getVoip()
467
    {
468 1524
        return $this->voip;
469
    }
470
471 866
    public function setVoip(PhoneNumberDesc $value)
472
    {
473 866
        $this->voip = $value;
474 866
        return $this;
475
    }
476
477
    protected $pager;
478
479
    public function hasPager()
480
    {
481
        return isset($this->pager);
482
    }
483
484
    /**
485
     * @return PhoneNumberDesc
486
     */
487 1436
    public function getPager()
488
    {
489 1436
        return $this->pager;
490
    }
491
492 866
    public function setPager(PhoneNumberDesc $value)
493
    {
494 866
        $this->pager = $value;
495 866
        return $this;
496
    }
497
498
    protected $uan;
499
500
    public function hasUan()
501
    {
502
        return isset($this->uan);
503
    }
504
505
    /**
506
     * @return PhoneNumberDesc
507
     */
508 1384
    public function getUan()
509
    {
510 1384
        return $this->uan;
511
    }
512
513 866
    public function setUan(PhoneNumberDesc $value)
514
    {
515 866
        $this->uan = $value;
516 866
        return $this;
517
    }
518
519
    protected $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 866
    public function setEmergency(PhoneNumberDesc $value)
535
    {
536 866
        $this->emergency = $value;
537 866
        return $this;
538
    }
539
540
    protected $voicemail;
541
542
    public function hasVoicemail()
543
    {
544
        return isset($this->voicemail);
545
    }
546
547
    /**
548
     * @return PhoneNumberDesc
549
     */
550 1370
    public function getVoicemail()
551
    {
552 1370
        return $this->voicemail;
553
    }
554
555 866
    public function setVoicemail(PhoneNumberDesc $value)
556
    {
557 866
        $this->voicemail = $value;
558 866
        return $this;
559
    }
560
561
    /**
562
     * @var PhoneNumberDesc
563
     */
564
    protected $short_code;
565
566
    public function hasShortCode()
567
    {
568
        return isset($this->short_code);
569
    }
570
571 247
    public function getShortCode()
572
    {
573 247
        return $this->short_code;
574
    }
575
576 866
    public function setShortCode(PhoneNumberDesc $value)
577
    {
578 866
        $this->short_code = $value;
579 866
        return $this;
580
    }
581
582
    /**
583
     * @var PhoneNumberDesc
584
     */
585
    protected $standard_rate;
586
587
    public function hasStandardRate()
588
    {
589
        return isset($this->standard_rate);
590
    }
591
592 526
    public function getStandardRate()
593
    {
594 526
        return $this->standard_rate;
595
    }
596
597 866
    public function setStandardRate(PhoneNumberDesc $value)
598
    {
599 866
        $this->standard_rate = $value;
600 866
        return $this;
601
    }
602
603
    /**
604
     * @var PhoneNumberDesc
605
     */
606
    protected $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 866
    public function setCarrierSpecific(PhoneNumberDesc $value)
619
    {
620 866
        $this->carrierSpecific = $value;
621 866
        return $this;
622
    }
623
624
    /**
625
     * @var PhoneNumberDesc
626
     */
627
    protected $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 866
    public function setNoInternationalDialling(PhoneNumberDesc $value)
640
    {
641 866
        $this->noInternationalDialling = $value;
642 866
        return $this;
643
    }
644
645
    /**
646
     *
647
     * @var NumberFormat[]
648
     */
649
    protected $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 122
    public function addIntlNumberFormat(NumberFormat $value)
667
    {
668 122
        $this->intlNumberFormat[] = $value;
669 122
        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 866
    public function fromArray(array $input)
804
    {
805 866
        if (isset($input['generalDesc'])) {
806 866
            $desc = new PhoneNumberDesc();
807 866
            $this->setGeneralDesc($desc->fromArray($input['generalDesc']));
808
        }
809
810 866
        if (isset($input['fixedLine'])) {
811 866
            $desc = new PhoneNumberDesc();
812 866
            $this->setFixedLine($desc->fromArray($input['fixedLine']));
813
        }
814
815 866
        if (isset($input['mobile'])) {
816 866
            $desc = new PhoneNumberDesc();
817 866
            $this->setMobile($desc->fromArray($input['mobile']));
818
        }
819
820 866
        if (isset($input['tollFree'])) {
821 866
            $desc = new PhoneNumberDesc();
822 866
            $this->setTollFree($desc->fromArray($input['tollFree']));
823
        }
824
825 866
        if (isset($input['premiumRate'])) {
826 866
            $desc = new PhoneNumberDesc();
827 866
            $this->setPremiumRate($desc->fromArray($input['premiumRate']));
828
        }
829
830 866
        if (isset($input['sharedCost'])) {
831 866
            $desc = new PhoneNumberDesc();
832 866
            $this->setSharedCost($desc->fromArray($input['sharedCost']));
833
        }
834
835 866
        if (isset($input['personalNumber'])) {
836 866
            $desc = new PhoneNumberDesc();
837 866
            $this->setPersonalNumber($desc->fromArray($input['personalNumber']));
838
        }
839
840 866
        if (isset($input['voip'])) {
841 866
            $desc = new PhoneNumberDesc();
842 866
            $this->setVoip($desc->fromArray($input['voip']));
843
        }
844
845 866
        if (isset($input['pager'])) {
846 866
            $desc = new PhoneNumberDesc();
847 866
            $this->setPager($desc->fromArray($input['pager']));
848
        }
849
850 866
        if (isset($input['uan'])) {
851 866
            $desc = new PhoneNumberDesc();
852 866
            $this->setUan($desc->fromArray($input['uan']));
853
        }
854
855 866
        if (isset($input['emergency'])) {
856 866
            $desc = new PhoneNumberDesc();
857 866
            $this->setEmergency($desc->fromArray($input['emergency']));
858
        }
859
860 866
        if (isset($input['voicemail'])) {
861 866
            $desc = new PhoneNumberDesc();
862 866
            $this->setVoicemail($desc->fromArray($input['voicemail']));
863
        }
864
865 866
        if (isset($input['shortCode'])) {
866 866
            $desc = new PhoneNumberDesc();
867 866
            $this->setShortCode(($desc->fromArray($input['shortCode'])));
868
        }
869
870 866
        if (isset($input['standardRate'])) {
871 866
            $desc = new PhoneNumberDesc();
872 866
            $this->setStandardRate($desc->fromArray($input['standardRate']));
873
        }
874
875 866
        if (isset($input['carrierSpecific'])) {
876 866
            $desc = new PhoneNumberDesc();
877 866
            $this->setCarrierSpecific($desc->fromArray($input['carrierSpecific']));
878
        }
879
880 866
        if (isset($input['noInternationalDialling'])) {
881 866
            $desc = new PhoneNumberDesc();
882 866
            $this->setNoInternationalDialling($desc->fromArray($input['noInternationalDialling']));
883
        }
884
885 866
        $this->setId($input['id']);
886 866
        $this->setCountryCode($input['countryCode']);
887 866
        $this->setInternationalPrefix($input['internationalPrefix']);
888
889 866
        if (isset($input['preferredInternationalPrefix'])) {
890 60
            $this->setPreferredInternationalPrefix($input['preferredInternationalPrefix']);
891
        }
892 866
        if (isset($input['nationalPrefix'])) {
893 390
            $this->setNationalPrefix($input['nationalPrefix']);
894
        }
895 866
        if (isset($input['nationalPrefix'])) {
896 390
            $this->setNationalPrefix($input['nationalPrefix']);
897
        }
898
899 866
        if (isset($input['preferredExtnPrefix'])) {
900 84
            $this->setPreferredExtnPrefix($input['preferredExtnPrefix']);
901
        }
902
903 866
        if (isset($input['nationalPrefixForParsing'])) {
904 400
            $this->setNationalPrefixForParsing($input['nationalPrefixForParsing']);
905
        }
906
907 866
        if (isset($input['nationalPrefixTransformRule'])) {
908 27
            $this->setNationalPrefixTransformRule($input['nationalPrefixTransformRule']);
909
        }
910
911 866
        foreach ($input['numberFormat'] as $numberFormatElt) {
912 556
            $numberFormat = new NumberFormat();
913 556
            $numberFormat->fromArray($numberFormatElt);
914 556
            $this->addNumberFormat($numberFormat);
915
        }
916
917 866
        foreach ($input['intlNumberFormat'] as $intlNumberFormatElt) {
918 122
            $numberFormat = new NumberFormat();
919 122
            $numberFormat->fromArray($intlNumberFormatElt);
920 122
            $this->addIntlNumberFormat($numberFormat);
921
        }
922
923 866
        $this->setMainCountryForCode($input['mainCountryForCode']);
924
925 866
        if (isset($input['leadingDigits'])) {
926 53
            $this->setLeadingDigits($input['leadingDigits']);
927
        }
928
929 866
        $this->setLeadingZeroPossible($input['leadingZeroPossible']);
930
931 866
        $this->setMobileNumberPortableRegion($input['mobileNumberPortableRegion']);
932
933 866
        return $this;
934
    }
935
}
936