當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PhoneNumber::isItalianLeadingZero方法代碼示例

本文整理匯總了PHP中PhoneNumber::isItalianLeadingZero方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhoneNumber::isItalianLeadingZero方法的具體用法?PHP PhoneNumber::isItalianLeadingZero怎麽用?PHP PhoneNumber::isItalianLeadingZero使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PhoneNumber的用法示例。


在下文中一共展示了PhoneNumber::isItalianLeadingZero方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: hasUnexpectedItalianLeadingZero

 /**
  * Returns true if a number is from a region whose national significant number couldn't contain a
  * leading zero, but has the italian_leading_zero field set to true.
  * @param PhoneNumber $number
  * @return bool
  */
 private function hasUnexpectedItalianLeadingZero(PhoneNumber $number)
 {
     return $number->isItalianLeadingZero() && !$this->isLeadingZeroPossible($number->getCountryCode());
 }
開發者ID:kasirye,項目名稱:faveo-helpdesk,代碼行數:10,代碼來源:PhoneNumberUtil.php

示例2: getNationalSignificantNumber

 /**
  * Gets the national significant number of the a phone number. Note a national significant number
  * doesn't contain a national prefix or any formatting.
  *
  * @param \libphonenumber\PhoneNumber $number the phone number for which the national significant number is needed
  * @return string  the national significant number of the PhoneNumber object passed in
  */
 public function getNationalSignificantNumber(PhoneNumber $number)
 {
     // If a leading zero has been set, we prefix this now. Note this is not a national prefix.
     $nationalNumber = $number->isItalianLeadingZero() ? "0" : "";
     $nationalNumber .= $number->getNationalNumber();
     return $nationalNumber;
 }
開發者ID:jpresult,項目名稱:libphonenumber-for-php,代碼行數:14,代碼來源:PhoneNumberUtil.php

示例3: mergeFrom

 /**
  * Merges the information from another phone number into this phone number.
  *
  * @param PhoneNumber $other The phone number to copy.
  *
  * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
  */
 public function mergeFrom(PhoneNumber $other)
 {
     if ($other->hasCountryCode()) {
         $this->setCountryCode($other->getCountryCode());
     }
     if ($other->hasNationalNumber()) {
         $this->setNationalNumber($other->getNationalNumber());
     }
     if ($other->hasExtension()) {
         $this->setExtension($other->getExtension());
     }
     if ($other->hasItalianLeadingZero()) {
         $this->setItalianLeadingZero($other->isItalianLeadingZero());
     }
     if ($other->hasNumberOfLeadingZeros()) {
         $this->setNumberOfLeadingZeros($other->getNumberOfLeadingZeros());
     }
     if ($other->hasRawInput()) {
         $this->setRawInput($other->getRawInput());
     }
     if ($other->hasCountryCodeSource()) {
         $this->setCountryCodeSource($other->getCountryCodeSource());
     }
     if ($other->hasPreferredDomesticCarrierCode()) {
         $this->setPreferredDomesticCarrierCode($other->getPreferredDomesticCarrierCode());
     }
     return $this;
 }
開發者ID:hdkhanhkhtn,項目名稱:libphonenumber-for-php,代碼行數:35,代碼來源:PhoneNumber.php

示例4: getNationalSignificantNumber

 /**
  * Gets the national significant number of the a phone number. Note a national significant number
  * doesn't contain a national prefix or any formatting.
  * <p>
  * This is a temporary duplicate of the {@code getNationalSignificantNumber} method from
  * {@code PhoneNumberUtil}. Ultimately a canonical static version should exist in a separate
  * utility class (to prevent {@code ShortNumberInfo} needing to depend on PhoneNumberUtil).
  *
  * @param PhoneNumber $number the phone number for which the national significant number is needed
  * @return string the national significant number of the PhoneNumber object passed in
  */
 private function getNationalSignificantNumber(PhoneNumber $number)
 {
     // If leading zero(s) have been set, we prefix this now. Note this is not a national prefix.
     $nationalNumber = '';
     if ($number->isItalianLeadingZero()) {
         $zeros = str_repeat('0', $number->getNumberOfLeadingZeros());
         $nationalNumber .= $zeros;
     }
     $nationalNumber .= $number->getNationalNumber();
     return $nationalNumber;
 }
開發者ID:kidaa30,項目名稱:Constant-Contact-WordPress-Plugin,代碼行數:22,代碼來源:ShortNumberInfo.php


注:本文中的PhoneNumber::isItalianLeadingZero方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。