Completed
Push — master ( dd9cf2...939550 )
by Joshua
13s
created

PhoneMetadata::hasCarrierSpecific()   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 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
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 $smsServices;
63
    /**
64
     * @var PhoneNumberDesc
65
     */
66
    protected $noInternationalDialling = null;
67
    /**
68
     *
69
     * @var NumberFormat[]
70
     */
71
    protected $intlNumberFormat = array();
72
73
    /**
74
     * @return boolean
75
     */
76
    public function hasId()
77
    {
78
        return isset($this->id);
79
    }
80
81
    /**
82
     * @return boolean
83
     */
84 483
    public function hasCountryCode()
85
    {
86 483
        return isset($this->countryCode);
87
    }
88
89 483
    public function hasInternationalPrefix()
90
    {
91 483
        return isset($this->internationalPrefix);
92
    }
93
94
    public function hasMainCountryForCode()
95
    {
96
        return isset($this->mainCountryForCode);
97
    }
98
99 2
    public function isMainCountryForCode()
100
    {
101 2
        return $this->mainCountryForCode;
102
    }
103
104 483
    public function getMainCountryForCode()
105
    {
106 483
        return $this->mainCountryForCode;
107
    }
108
109 1571
    public function setMainCountryForCode($value)
110
    {
111 1571
        $this->mainCountryForCode = $value;
112 1571
        return $this;
113
    }
114
115 2
    public function clearMainCountryForCode()
116
    {
117 2
        $this->mainCountryForCode = false;
118 2
        return $this;
119
    }
120
121 483
    public function hasLeadingZeroPossible()
122
    {
123 483
        return isset($this->leadingZeroPossible);
124
    }
125
126 483
    public function hasMobileNumberPortableRegion()
127
    {
128 483
        return isset($this->mobileNumberPortableRegion);
129
    }
130
131 483
    public function hasSameMobileAndFixedLinePattern()
132
    {
133 483
        return isset($this->sameMobileAndFixedLinePattern);
134
    }
135
136 2
    public function numberFormatSize()
137
    {
138 2
        return count($this->numberFormat);
139
    }
140
141
    /**
142
     * @param int $index
143
     * @return NumberFormat
144
     */
145 11
    public function getNumberFormat($index)
146
    {
147 11
        return $this->numberFormat[$index];
148
    }
149
150 27
    public function intlNumberFormatSize()
151
    {
152 27
        return count($this->intlNumberFormat);
153
    }
154
155 6
    public function getIntlNumberFormat($index)
156
    {
157 6
        return $this->intlNumberFormat[$index];
158
    }
159
160 7
    public function clearIntlNumberFormat()
161
    {
162 7
        $this->intlNumberFormat = array();
163 7
        return $this;
164
    }
165
166 483
    public function toArray()
167
    {
168 483
        $output = array();
169
170 483
        if ($this->hasGeneralDesc()) {
171 483
            $output['generalDesc'] = $this->getGeneralDesc()->toArray();
172
        }
173
174 483
        if ($this->hasFixedLine()) {
175 244
            $output['fixedLine'] = $this->getFixedLine()->toArray();
176
        }
177
178 483
        if ($this->hasMobile()) {
179 244
            $output['mobile'] = $this->getMobile()->toArray();
180
        }
181
182 483
        if ($this->hasTollFree()) {
183 483
            $output['tollFree'] = $this->getTollFree()->toArray();
184
        }
185
186 483
        if ($this->hasPremiumRate()) {
187 483
            $output['premiumRate'] = $this->getPremiumRate()->toArray();
188
        }
189
190 483
        if ($this->hasPremiumRate()) {
191 483
            $output['premiumRate'] = $this->getPremiumRate()->toArray();
192
        }
193
194 483
        if ($this->hasSharedCost()) {
195 244
            $output['sharedCost'] = $this->getSharedCost()->toArray();
196
        }
197
198 483
        if ($this->hasPersonalNumber()) {
199 244
            $output['personalNumber'] = $this->getPersonalNumber()->toArray();
200
        }
201
202 483
        if ($this->hasVoip()) {
203 244
            $output['voip'] = $this->getVoip()->toArray();
204
        }
205
206 483
        if ($this->hasPager()) {
207 244
            $output['pager'] = $this->getPager()->toArray();
208
        }
209
210 483
        if ($this->hasUan()) {
211 244
            $output['uan'] = $this->getUan()->toArray();
212
        }
213
214 483
        if ($this->hasEmergency()) {
215 239
            $output['emergency'] = $this->getEmergency()->toArray();
216
        }
217
218 483
        if ($this->hasVoicemail()) {
219 244
            $output['voicemail'] = $this->getVoicemail()->toArray();
220
        }
221
222 483
        if ($this->hasShortCode()) {
223 239
            $output['shortCode'] = $this->getShortCode()->toArray();
224
        }
225
226 483
        if ($this->hasStandardRate()) {
227 239
            $output['standardRate'] = $this->getStandardRate()->toArray();
228
        }
229
230 483
        if ($this->hasCarrierSpecific()) {
231 239
            $output['carrierSpecific'] = $this->getCarrierSpecific()->toArray();
232
        }
233
234 483
        if ($this->hasSmsServices()) {
235 239
            $output['smsServices'] = $this->getSmsServices()->toArray();
236
        }
237
238 483
        if ($this->hasNoInternationalDialling()) {
239 244
            $output['noInternationalDialling'] = $this->getNoInternationalDialling()->toArray();
240
        }
241
242 483
        $output['id'] = $this->getId();
243 483
        if ($this->hasCountryCode()) {
244 483
            $output['countryCode'] = $this->getCountryCode();
245
        }
246
247 483
        if ($this->hasInternationalPrefix()) {
248 483
            $output['internationalPrefix'] = $this->getInternationalPrefix();
249
        }
250
251 483
        if ($this->hasPreferredInternationalPrefix()) {
252 23
            $output['preferredInternationalPrefix'] = $this->getPreferredInternationalPrefix();
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $output['preferredInternationalPrefix'] is correct as $this->getPreferredInternationalPrefix() (which targets libphonenumber\PhoneMeta...edInternationalPrefix()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
253
        }
254
255 483
        if ($this->hasNationalPrefix()) {
256 146
            $output['nationalPrefix'] = $this->getNationalPrefix();
257
        }
258
259 483
        if ($this->hasPreferredExtnPrefix()) {
260 5
            $output['preferredExtnPrefix'] = $this->getPreferredExtnPrefix();
261
        }
262
263 483
        if ($this->hasNationalPrefixForParsing()) {
264 151
            $output['nationalPrefixForParsing'] = $this->getNationalPrefixForParsing();
265
        }
266
267 483
        if ($this->hasNationalPrefixTransformRule()) {
268 4
            $output['nationalPrefixTransformRule'] = $this->getNationalPrefixTransformRule();
269
        }
270
271 483
        if ($this->hasSameMobileAndFixedLinePattern()) {
272 483
            $output['sameMobileAndFixedLinePattern'] = $this->getSameMobileAndFixedLinePattern();
273
        }
274
275 483
        $output['numberFormat'] = array();
276 483
        foreach ($this->numberFormats() as $numberFormat) {
277 198
            $output['numberFormat'][] = $numberFormat->toArray();
278
        }
279
280 483
        $output['intlNumberFormat'] = array();
281 483
        foreach ($this->intlNumberFormats() as $intlNumberFormat) {
282 16
            $output['intlNumberFormat'][] = $intlNumberFormat->toArray();
283
        }
284
285 483
        $output['mainCountryForCode'] = $this->getMainCountryForCode();
286
287 483
        if ($this->hasLeadingDigits()) {
288 26
            $output['leadingDigits'] = $this->getLeadingDigits();
289
        }
290
291 483
        if ($this->hasLeadingZeroPossible()) {
292 483
            $output['leadingZeroPossible'] = $this->isLeadingZeroPossible();
293
        }
294
295 483
        if ($this->hasMobileNumberPortableRegion()) {
296 483
            $output['mobileNumberPortableRegion'] = $this->isMobileNumberPortableRegion();
297
        }
298
299 483
        return $output;
300
    }
301
302 486
    public function hasGeneralDesc()
303
    {
304 486
        return isset($this->generalDesc);
305
    }
306
307
    /**
308
     * @return PhoneNumberDesc
309
     */
310 3601
    public function getGeneralDesc()
311
    {
312 3601
        return $this->generalDesc;
313
    }
314
315 1582
    public function setGeneralDesc(PhoneNumberDesc $value)
316
    {
317 1582
        $this->generalDesc = $value;
318 1582
        return $this;
319
    }
320
321 489
    public function hasFixedLine()
322
    {
323 489
        return isset($this->fixedLine);
324
    }
325
326
    /**
327
     * @return PhoneNumberDesc
328
     */
329 1863
    public function getFixedLine()
330
    {
331 1863
        return $this->fixedLine;
332
    }
333
334 1086
    public function setFixedLine(PhoneNumberDesc $value)
335
    {
336 1086
        $this->fixedLine = $value;
337 1086
        return $this;
338
    }
339
340 489
    public function hasMobile()
341
    {
342 489
        return isset($this->mobile);
343
    }
344
345
    /**
346
     * @return PhoneNumberDesc
347
     */
348 1475
    public function getMobile()
349
    {
350 1475
        return $this->mobile;
351
    }
352
353 1086
    public function setMobile(PhoneNumberDesc $value)
354
    {
355 1086
        $this->mobile = $value;
356 1086
        return $this;
357
    }
358
359 489
    public function hasTollFree()
360
    {
361 489
        return isset($this->tollFree);
362
    }
363
364
    /**
365
     * @return PhoneNumberDesc
366
     */
367 2733
    public function getTollFree()
368
    {
369 2733
        return $this->tollFree;
370
    }
371
372 1579
    public function setTollFree(PhoneNumberDesc $value)
373
    {
374 1579
        $this->tollFree = $value;
375 1579
        return $this;
376
    }
377
378 489
    public function hasPremiumRate()
379
    {
380 489
        return isset($this->premiumRate);
381
    }
382
383
    /**
384
     * @return PhoneNumberDesc
385
     */
386 2981
    public function getPremiumRate()
387
    {
388 2981
        return $this->premiumRate;
389
    }
390
391 1576
    public function setPremiumRate(PhoneNumberDesc $value)
392
    {
393 1576
        $this->premiumRate = $value;
394 1576
        return $this;
395
    }
396
397 489
    public function hasSharedCost()
398
    {
399 489
        return isset($this->sharedCost);
400
    }
401
402
    /**
403
     * @return PhoneNumberDesc
404
     */
405 1937
    public function getSharedCost()
406
    {
407 1937
        return $this->sharedCost;
408
    }
409
410 1083
    public function setSharedCost(PhoneNumberDesc $value)
411
    {
412 1083
        $this->sharedCost = $value;
413 1083
        return $this;
414
    }
415
416 489
    public function hasPersonalNumber()
417
    {
418 489
        return isset($this->personalNumber);
419
    }
420
421
    /**
422
     * @return PhoneNumberDesc
423
     */
424 1790
    public function getPersonalNumber()
425
    {
426 1790
        return $this->personalNumber;
427
    }
428
429 1083
    public function setPersonalNumber(PhoneNumberDesc $value)
430
    {
431 1083
        $this->personalNumber = $value;
432 1083
        return $this;
433
    }
434
435 489
    public function hasVoip()
436
    {
437 489
        return isset($this->voip);
438
    }
439
440
    /**
441
     * @return PhoneNumberDesc
442
     */
443 1855
    public function getVoip()
444
    {
445 1855
        return $this->voip;
446
    }
447
448 1083
    public function setVoip(PhoneNumberDesc $value)
449
    {
450 1083
        $this->voip = $value;
451 1083
        return $this;
452
    }
453
454 489
    public function hasPager()
455
    {
456 489
        return isset($this->pager);
457
    }
458
459
    /**
460
     * @return PhoneNumberDesc
461
     */
462 1764
    public function getPager()
463
    {
464 1764
        return $this->pager;
465
    }
466
467 1083
    public function setPager(PhoneNumberDesc $value)
468
    {
469 1083
        $this->pager = $value;
470 1083
        return $this;
471
    }
472
473 489
    public function hasUan()
474
    {
475 489
        return isset($this->uan);
476
    }
477
478
    /**
479
     * @return PhoneNumberDesc
480
     */
481 1718
    public function getUan()
482
    {
483 1718
        return $this->uan;
484
    }
485
486 1083
    public function setUan(PhoneNumberDesc $value)
487
    {
488 1083
        $this->uan = $value;
489 1083
        return $this;
490
    }
491
492 750
    public function hasEmergency()
493
    {
494 750
        return isset($this->emergency);
495
    }
496
497
    /**
498
     * @return PhoneNumberDesc
499
     */
500 501
    public function getEmergency()
501
    {
502 501
        return $this->emergency;
503
    }
504
505 501
    public function setEmergency(PhoneNumberDesc $value)
506
    {
507 501
        $this->emergency = $value;
508 501
        return $this;
509
    }
510
511 489
    public function hasVoicemail()
512
    {
513 489
        return isset($this->voicemail);
514
    }
515
516
    /**
517
     * @return PhoneNumberDesc
518
     */
519 1703
    public function getVoicemail()
520
    {
521 1703
        return $this->voicemail;
522
    }
523
524 1083
    public function setVoicemail(PhoneNumberDesc $value)
525
    {
526 1083
        $this->voicemail = $value;
527 1083
        return $this;
528
    }
529
530 489
    public function hasShortCode()
531
    {
532 489
        return isset($this->short_code);
533
    }
534
535 486
    public function getShortCode()
536
    {
537 486
        return $this->short_code;
538
    }
539
540 501
    public function setShortCode(PhoneNumberDesc $value)
541
    {
542 501
        $this->short_code = $value;
543 501
        return $this;
544
    }
545
546 489
    public function hasStandardRate()
547
    {
548 489
        return isset($this->standard_rate);
549
    }
550
551 775
    public function getStandardRate()
552
    {
553 775
        return $this->standard_rate;
554
    }
555
556 501
    public function setStandardRate(PhoneNumberDesc $value)
557
    {
558 501
        $this->standard_rate = $value;
559 501
        return $this;
560
    }
561
562 489
    public function hasCarrierSpecific()
563
    {
564 489
        return isset($this->carrierSpecific);
565
    }
566
567 480
    public function getCarrierSpecific()
568
    {
569 480
        return $this->carrierSpecific;
570
    }
571
572 501
    public function setCarrierSpecific(PhoneNumberDesc $value)
573
    {
574 501
        $this->carrierSpecific = $value;
575 501
        return $this;
576
    }
577
578 489
    public function hasSmsServices()
579
    {
580 489
        return isset($this->smsServices);
581
    }
582
583 480
    public function getSmsServices()
584
    {
585 480
        return $this->smsServices;
586
    }
587
588 501
    public function setSmsServices(PhoneNumberDesc $value)
589
    {
590 501
        $this->smsServices = $value;
591 501
        return $this;
592
    }
593
594 489
    public function hasNoInternationalDialling()
595
    {
596 489
        return isset($this->noInternationalDialling);
597
    }
598
599 493
    public function getNoInternationalDialling()
600
    {
601 493
        return $this->noInternationalDialling;
602
    }
603
604 1083
    public function setNoInternationalDialling(PhoneNumberDesc $value)
605
    {
606 1083
        $this->noInternationalDialling = $value;
607 1083
        return $this;
608
    }
609
610
    /**
611
     * @return string
612
     */
613 501
    public function getId()
614
    {
615 501
        return $this->id;
616
    }
617
618
    /**
619
     * @param string $value
620
     * @return PhoneMetadata
621
     */
622 1583
    public function setId($value)
623
    {
624 1583
        $this->id = $value;
625 1583
        return $this;
626
    }
627
628
    /**
629
     * @return int
630
     */
631 3569
    public function getCountryCode()
632
    {
633 3569
        return $this->countryCode;
634
    }
635
636
    /**
637
     * @param int $value
638
     * @return PhoneMetadata
639
     */
640 1583
    public function setCountryCode($value)
641
    {
642 1583
        $this->countryCode = $value;
643 1583
        return $this;
644
    }
645
646 3567
    public function getInternationalPrefix()
647
    {
648 3567
        return $this->internationalPrefix;
649
    }
650
651 1583
    public function setInternationalPrefix($value)
652
    {
653 1583
        $this->internationalPrefix = $value;
654 1583
        return $this;
655
    }
656
657 487
    public function hasPreferredInternationalPrefix()
658
    {
659 487
        return ($this->preferredInternationalPrefix !== null);
660
    }
661
662 30
    public function getPreferredInternationalPrefix()
663
    {
664 30
        return $this->preferredInternationalPrefix;
665
    }
666
667 97
    public function setPreferredInternationalPrefix($value)
668
    {
669 97
        $this->preferredInternationalPrefix = $value;
670 97
        return $this;
671
    }
672
673 2
    public function clearPreferredInternationalPrefix()
674
    {
675 2
        $this->preferredInternationalPrefix = null;
676 2
        return $this;
677
    }
678
679 516
    public function hasNationalPrefix()
680
    {
681 516
        return isset($this->nationalPrefix);
682
    }
683
684 179
    public function getNationalPrefix()
685
    {
686 179
        return $this->nationalPrefix;
687
    }
688
689 754
    public function setNationalPrefix($value)
690
    {
691 754
        $this->nationalPrefix = $value;
692 754
        return $this;
693
    }
694
695
    public function clearNationalPrefix()
696
    {
697
        $this->nationalPrefix = '';
698
        return $this;
699
    }
700
701 486
    public function hasPreferredExtnPrefix()
702
    {
703 486
        return isset($this->preferredExtnPrefix);
704
    }
705
706 8
    public function getPreferredExtnPrefix()
707
    {
708 8
        return $this->preferredExtnPrefix;
709
    }
710
711 193
    public function setPreferredExtnPrefix($value)
712
    {
713 193
        $this->preferredExtnPrefix = $value;
714 193
        return $this;
715
    }
716
717 2
    public function clearPreferredExtnPrefix()
718
    {
719 2
        $this->preferredExtnPrefix = '';
720 2
        return $this;
721
    }
722
723 512
    public function hasNationalPrefixForParsing()
724
    {
725 512
        return isset($this->nationalPrefixForParsing);
726
    }
727
728 3235
    public function getNationalPrefixForParsing()
729
    {
730 3235
        return $this->nationalPrefixForParsing;
731
    }
732
733 771
    public function setNationalPrefixForParsing($value)
734
    {
735 771
        $this->nationalPrefixForParsing = $value;
736 771
        return $this;
737
    }
738
739 483
    public function hasNationalPrefixTransformRule()
740
    {
741 483
        return isset($this->nationalPrefixTransformRule);
742
    }
743
744 153
    public function getNationalPrefixTransformRule()
745
    {
746 153
        return $this->nationalPrefixTransformRule;
747
    }
748
749 52
    public function setNationalPrefixTransformRule($value)
750
    {
751 52
        $this->nationalPrefixTransformRule = $value;
752 52
        return $this;
753
    }
754
755 2
    public function clearNationalPrefixTransformRule()
756
    {
757 2
        $this->nationalPrefixTransformRule = '';
758 2
        return $this;
759
    }
760
761 1686
    public function getSameMobileAndFixedLinePattern()
762
    {
763 1686
        return $this->sameMobileAndFixedLinePattern;
764
    }
765
766 5
    public function setSameMobileAndFixedLinePattern($value)
767
    {
768 5
        $this->sameMobileAndFixedLinePattern = $value;
769 5
        return $this;
770
    }
771
772 2
    public function clearSameMobileAndFixedLinePattern()
773
    {
774 2
        $this->sameMobileAndFixedLinePattern = false;
775 2
        return $this;
776
    }
777
778
    /**
779
     * @return NumberFormat[]
780
     */
781 633
    public function numberFormats()
782
    {
783 633
        return $this->numberFormat;
784
    }
785
786 590
    public function intlNumberFormats()
787
    {
788 590
        return $this->intlNumberFormat;
789
    }
790
791
    /**
792
     * @return bool
793
     */
794 1079
    public function hasLeadingDigits()
795
    {
796 1079
        return isset($this->leadingDigits);
797
    }
798
799 201
    public function getLeadingDigits()
800
    {
801 201
        return $this->leadingDigits;
802
    }
803
804 80
    public function setLeadingDigits($value)
805
    {
806 80
        $this->leadingDigits = $value;
807 80
        return $this;
808
    }
809
810 483
    public function isLeadingZeroPossible()
811
    {
812 483
        return $this->leadingZeroPossible;
813
    }
814
815 1570
    public function setLeadingZeroPossible($value)
816
    {
817 1570
        $this->leadingZeroPossible = $value;
818 1570
        return $this;
819
    }
820
821 2
    public function clearLeadingZeroPossible()
822
    {
823 2
        $this->leadingZeroPossible = false;
824 2
        return $this;
825
    }
826
827 488
    public function isMobileNumberPortableRegion()
828
    {
829 488
        return $this->mobileNumberPortableRegion;
830
    }
831
832 1571
    public function setMobileNumberPortableRegion($value)
833
    {
834 1571
        $this->mobileNumberPortableRegion = $value;
835 1571
        return $this;
836
    }
837
838 2
    public function clearMobileNumberPortableRegion()
839
    {
840 2
        $this->mobileNumberPortableRegion = false;
841 2
        return $this;
842
    }
843
844
    /**
845
     * @param array $input
846
     * @return PhoneMetadata
847
     */
848 1570
    public function fromArray(array $input)
849
    {
850 1570
        if (isset($input['generalDesc'])) {
851 1570
            $desc = new PhoneNumberDesc();
852 1570
            $this->setGeneralDesc($desc->fromArray($input['generalDesc']));
853
        }
854
855 1570
        if (isset($input['fixedLine'])) {
856 1078
            $desc = new PhoneNumberDesc();
857 1078
            $this->setFixedLine($desc->fromArray($input['fixedLine']));
858
        }
859
860 1570
        if (isset($input['mobile'])) {
861 1078
            $desc = new PhoneNumberDesc();
862 1078
            $this->setMobile($desc->fromArray($input['mobile']));
863
        }
864
865 1570
        if (isset($input['tollFree'])) {
866 1570
            $desc = new PhoneNumberDesc();
867 1570
            $this->setTollFree($desc->fromArray($input['tollFree']));
868
        }
869
870 1570
        if (isset($input['premiumRate'])) {
871 1570
            $desc = new PhoneNumberDesc();
872 1570
            $this->setPremiumRate($desc->fromArray($input['premiumRate']));
873
        }
874
875 1570
        if (isset($input['sharedCost'])) {
876 1078
            $desc = new PhoneNumberDesc();
877 1078
            $this->setSharedCost($desc->fromArray($input['sharedCost']));
878
        }
879
880 1570
        if (isset($input['personalNumber'])) {
881 1078
            $desc = new PhoneNumberDesc();
882 1078
            $this->setPersonalNumber($desc->fromArray($input['personalNumber']));
883
        }
884
885 1570
        if (isset($input['voip'])) {
886 1078
            $desc = new PhoneNumberDesc();
887 1078
            $this->setVoip($desc->fromArray($input['voip']));
888
        }
889
890 1570
        if (isset($input['pager'])) {
891 1078
            $desc = new PhoneNumberDesc();
892 1078
            $this->setPager($desc->fromArray($input['pager']));
893
        }
894
895 1570
        if (isset($input['uan'])) {
896 1078
            $desc = new PhoneNumberDesc();
897 1078
            $this->setUan($desc->fromArray($input['uan']));
898
        }
899
900 1570
        if (isset($input['emergency'])) {
901 500
            $desc = new PhoneNumberDesc();
902 500
            $this->setEmergency($desc->fromArray($input['emergency']));
903
        }
904
905 1570
        if (isset($input['voicemail'])) {
906 1078
            $desc = new PhoneNumberDesc();
907 1078
            $this->setVoicemail($desc->fromArray($input['voicemail']));
908
        }
909
910 1570
        if (isset($input['shortCode'])) {
911 500
            $desc = new PhoneNumberDesc();
912 500
            $this->setShortCode(($desc->fromArray($input['shortCode'])));
913
        }
914
915 1570
        if (isset($input['standardRate'])) {
916 500
            $desc = new PhoneNumberDesc();
917 500
            $this->setStandardRate($desc->fromArray($input['standardRate']));
918
        }
919
920 1570
        if (isset($input['carrierSpecific'])) {
921 500
            $desc = new PhoneNumberDesc();
922 500
            $this->setCarrierSpecific($desc->fromArray($input['carrierSpecific']));
923
        }
924
925 1570
        if (isset($input['smsServices'])) {
926 500
            $desc = new PhoneNumberDesc();
927 500
            $this->setSmsServices($desc->fromArray($input['smsServices']));
928
        }
929
930 1570
        if (isset($input['noInternationalDialling'])) {
931 1078
            $desc = new PhoneNumberDesc();
932 1078
            $this->setNoInternationalDialling($desc->fromArray($input['noInternationalDialling']));
933
        }
934
935 1570
        $this->setId($input['id']);
936 1570
        $this->setCountryCode($input['countryCode']);
937 1570
        $this->setInternationalPrefix($input['internationalPrefix']);
938
939 1570
        if (isset($input['preferredInternationalPrefix'])) {
940 93
            $this->setPreferredInternationalPrefix($input['preferredInternationalPrefix']);
941
        }
942 1570
        if (isset($input['nationalPrefix'])) {
943 751
            $this->setNationalPrefix($input['nationalPrefix']);
944
        }
945 1570
        if (isset($input['nationalPrefix'])) {
946 751
            $this->setNationalPrefix($input['nationalPrefix']);
947
        }
948
949 1570
        if (isset($input['preferredExtnPrefix'])) {
950 192
            $this->setPreferredExtnPrefix($input['preferredExtnPrefix']);
951
        }
952
953 1570
        if (isset($input['nationalPrefixForParsing'])) {
954 767
            $this->setNationalPrefixForParsing($input['nationalPrefixForParsing']);
955
        }
956
957 1570
        if (isset($input['nationalPrefixTransformRule'])) {
958 50
            $this->setNationalPrefixTransformRule($input['nationalPrefixTransformRule']);
959
        }
960
961 1570
        foreach ($input['numberFormat'] as $numberFormatElt) {
962 974
            $numberFormat = new NumberFormat();
963 974
            $numberFormat->fromArray($numberFormatElt);
964 974
            $this->addNumberFormat($numberFormat);
965
        }
966
967 1570
        foreach ($input['intlNumberFormat'] as $intlNumberFormatElt) {
968 262
            $numberFormat = new NumberFormat();
969 262
            $numberFormat->fromArray($intlNumberFormatElt);
970 262
            $this->addIntlNumberFormat($numberFormat);
971
        }
972
973 1570
        $this->setMainCountryForCode($input['mainCountryForCode']);
974
975 1570
        if (isset($input['leadingDigits'])) {
976 79
            $this->setLeadingDigits($input['leadingDigits']);
977
        }
978
979 1570
        if (isset($input['leadingZeroPossible'])) {
980 1570
            $this->setLeadingZeroPossible($input['leadingZeroPossible']);
981
        }
982
983 1570
        if (isset($input['mobileNumberPortableRegion'])) {
984 1570
            $this->setMobileNumberPortableRegion($input['mobileNumberPortableRegion']);
985
        }
986
987 1570
        return $this;
988
    }
989
990 982
    public function addNumberFormat(NumberFormat $value)
991
    {
992 982
        $this->numberFormat[] = $value;
993 982
        return $this;
994
    }
995
996 274
    public function addIntlNumberFormat(NumberFormat $value)
997
    {
998 274
        $this->intlNumberFormat[] = $value;
999 274
        return $this;
1000
    }
1001
}
1002