Completed
Push — master ( e55e95...1f7ab8 )
by Joshua
10:26
created

clearSameMobileAndFixedLinePattern()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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