public function fromArray(array $input) { if (isset($input['generalDesc'])) { $desc = new PhoneNumberDesc(); $this->setGeneralDesc($desc->fromArray($input['generalDesc'])); } if (isset($input['fixedLine'])) { $desc = new PhoneNumberDesc(); $this->setFixedLine($desc->fromArray($input['fixedLine'])); } if (isset($input['mobile'])) { $desc = new PhoneNumberDesc(); $this->setMobile($desc->fromArray($input['mobile'])); } if (isset($input['tollFree'])) { $desc = new PhoneNumberDesc(); $this->setTollFree($desc->fromArray($input['tollFree'])); } if (isset($input['premiumRate'])) { $desc = new PhoneNumberDesc(); $this->setPremiumRate($desc->fromArray($input['premiumRate'])); } if (isset($input['sharedCost'])) { $desc = new PhoneNumberDesc(); $this->setSharedCost($desc->fromArray($input['sharedCost'])); } /* hasDesc = objectInput.readBoolean(); if (hasDesc) { PhoneNumberDesc desc = new PhoneNumberDesc(); desc.readExternal(objectInput); setPersonalNumber(desc); } hasDesc = objectInput.readBoolean(); if (hasDesc) { PhoneNumberDesc desc = new PhoneNumberDesc(); desc.readExternal(objectInput); setVoip(desc); } hasDesc = objectInput.readBoolean(); if (hasDesc) { PhoneNumberDesc desc = new PhoneNumberDesc(); desc.readExternal(objectInput); setPager(desc); } hasDesc = objectInput.readBoolean(); if (hasDesc) { PhoneNumberDesc desc = new PhoneNumberDesc(); desc.readExternal(objectInput); setUan(desc); } hasDesc = objectInput.readBoolean(); if (hasDesc) { PhoneNumberDesc desc = new PhoneNumberDesc(); desc.readExternal(objectInput); setVoicemail(desc); } hasDesc = objectInput.readBoolean(); if (hasDesc) { PhoneNumberDesc desc = new PhoneNumberDesc(); desc.readExternal(objectInput); setEmergency(desc); } */ if (isset($input['noInternationalDialling'])) { $desc = new PhoneNumberDesc(); $this->setNoInternationalDialling($desc->fromArray($input['noInternationalDialling'])); } $this->setId($input['id']); $this->setCountryCode($input['countryCode']); $this->setInternationalPrefix($input['internationalPrefix']); if (isset($input['preferredInternationalPrefix'])) { $this->setPreferredInternationalPrefix($input['preferredInternationalPrefix']); } if (isset($input['nationalPrefix'])) { $this->setNationalPrefix($input['nationalPrefix']); } if (isset($input['nationalPrefix'])) { $this->setNationalPrefix($input['nationalPrefix']); } if (isset($input['preferredExtnPrefix'])) { $this->setPreferredExtnPrefix($input['preferredExtnPrefix']); } if (isset($input['nationalPrefixForParsing'])) { $this->setNationalPrefixForParsing($input['nationalPrefixForParsing']); } if (isset($input['nationalPrefixTransformRule'])) { $this->setNationalPrefixTransformRule($input['nationalPrefixTransformRule']); } /* setSameMobileAndFixedLinePattern(objectInput.readBoolean()); */ foreach ($input['numberFormat'] as $numberFormatElt) { $numberFormat = new NumberFormat(); $numberFormat->fromArray($numberFormatElt); $this->addNumberFormat($numberFormat); } foreach ($input['intlNumberFormat'] as $intlNumberFormatElt) { $numberFormat = new NumberFormat(); $numberFormat->fromArray($intlNumberFormatElt); $this->addIntlNumberFormat($numberFormat); } /* setMainCountryForCode(objectInput.readBoolean()); * */ $this->setMainCountryForCode($input['mainCountryForCode']); if (isset($input['leadingDigits'])) { $this->setLeadingDigits($input['leadingDigits']); } $this->setLeadingZeroPossible($input['leadingZeroPossible']); return $this; }
/** * @param array $input * @return PhoneMetadata */ public function fromArray(array $input) { if (isset($input['generalDesc'])) { $desc = new PhoneNumberDesc(); $this->setGeneralDesc($desc->fromArray($input['generalDesc'])); } if (isset($input['fixedLine'])) { $desc = new PhoneNumberDesc(); $this->setFixedLine($desc->fromArray($input['fixedLine'])); } if (isset($input['mobile'])) { $desc = new PhoneNumberDesc(); $this->setMobile($desc->fromArray($input['mobile'])); } if (isset($input['tollFree'])) { $desc = new PhoneNumberDesc(); $this->setTollFree($desc->fromArray($input['tollFree'])); } if (isset($input['premiumRate'])) { $desc = new PhoneNumberDesc(); $this->setPremiumRate($desc->fromArray($input['premiumRate'])); } if (isset($input['sharedCost'])) { $desc = new PhoneNumberDesc(); $this->setSharedCost($desc->fromArray($input['sharedCost'])); } if (isset($input['personalNumber'])) { $desc = new PhoneNumberDesc(); $this->setPersonalNumber($desc->fromArray($input['personalNumber'])); } if (isset($input['voip'])) { $desc = new PhoneNumberDesc(); $this->setVoip($desc->fromArray($input['voip'])); } if (isset($input['pager'])) { $desc = new PhoneNumberDesc(); $this->setPager($desc->fromArray($input['pager'])); } if (isset($input['uan'])) { $desc = new PhoneNumberDesc(); $this->setUan($desc->fromArray($input['uan'])); } if (isset($input['emergency'])) { $desc = new PhoneNumberDesc(); $this->setEmergency($desc->fromArray($input['emergency'])); } if (isset($input['voicemail'])) { $desc = new PhoneNumberDesc(); $this->setVoicemail($desc->fromArray($input['voicemail'])); } if (isset($input['shortCode'])) { $desc = new PhoneNumberDesc(); $this->setShortCode($desc->fromArray($input['shortCode'])); } if (isset($input['standardRate'])) { $desc = new PhoneNumberDesc(); $this->setStandardRate($desc->fromArray($input['standardRate'])); } if (isset($input['carrierSpecific'])) { $desc = new PhoneNumberDesc(); $this->setCarrierSpecific($desc->fromArray($input['carrierSpecific'])); } if (isset($input['noInternationalDialling'])) { $desc = new PhoneNumberDesc(); $this->setNoInternationalDialling($desc->fromArray($input['noInternationalDialling'])); } $this->setId($input['id']); $this->setCountryCode($input['countryCode']); $this->setInternationalPrefix($input['internationalPrefix']); if (isset($input['preferredInternationalPrefix'])) { $this->setPreferredInternationalPrefix($input['preferredInternationalPrefix']); } if (isset($input['nationalPrefix'])) { $this->setNationalPrefix($input['nationalPrefix']); } if (isset($input['nationalPrefix'])) { $this->setNationalPrefix($input['nationalPrefix']); } if (isset($input['preferredExtnPrefix'])) { $this->setPreferredExtnPrefix($input['preferredExtnPrefix']); } if (isset($input['nationalPrefixForParsing'])) { $this->setNationalPrefixForParsing($input['nationalPrefixForParsing']); } if (isset($input['nationalPrefixTransformRule'])) { $this->setNationalPrefixTransformRule($input['nationalPrefixTransformRule']); } foreach ($input['numberFormat'] as $numberFormatElt) { $numberFormat = new NumberFormat(); $numberFormat->fromArray($numberFormatElt); $this->addNumberFormat($numberFormat); } foreach ($input['intlNumberFormat'] as $intlNumberFormatElt) { $numberFormat = new NumberFormat(); $numberFormat->fromArray($intlNumberFormatElt); $this->addIntlNumberFormat($numberFormat); } $this->setMainCountryForCode($input['mainCountryForCode']); if (isset($input['leadingDigits'])) { $this->setLeadingDigits($input['leadingDigits']); } if (isset($input['leadingZeroPossible'])) { $this->setLeadingZeroPossible($input['leadingZeroPossible']); } if (isset($input['mobileNumberPortableRegion'])) { $this->setMobileNumberPortableRegion($input['mobileNumberPortableRegion']); } return $this; }