Completed
Push — dev-7.7.1 ( 5e6dff )
by Joshua
14:52
created

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