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