PHP Класс libphonenumber\PhoneNumberToTimeZonesMapper

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$instance PhoneNumberToTimeZonesMapper
$phoneUtil PhoneNumberUtil
$prefixTimeZonesMap
$unknownTimeZoneList

Открытые методы

Метод Описание
getInstance ( $mappingDir = self::MAPPING_DATA_DIRECTORY ) : PhoneNumberToTimeZonesMapper Gets a {@link PhoneNumberToTimeZonesMapper} instance.
getTimeZonesForGeographicalNumber ( PhoneNumber $number ) : array Returns a list of time zones to which a phone number belongs.
getTimeZonesForNumber ( PhoneNumber $number ) : array As per {@link #getTimeZonesForGeographicalNumber(PhoneNumber)} but explicitly checks the validity of the number passed in.
getUnknownTimeZone ( ) : string Returns a String with the ICU unknown time zone.

Защищенные методы

Метод Описание
__construct ( $phonePrefixDataDirectory )
getCountryLevelTimeZonesforNumber ( PhoneNumber $number ) : array Returns the list of time zones corresponding to the country calling code of {@code number}.
getTimeZonesForGeocodableNumber ( PhoneNumber $number ) : array Returns a list of time zones to which a geocodable phone number belongs.
loadPrefixTimeZonesMapFromFile ( $path )

Описание методов

__construct() защищенный Метод

protected __construct ( $phonePrefixDataDirectory )

getCountryLevelTimeZonesforNumber() защищенный Метод

Returns the list of time zones corresponding to the country calling code of {@code number}.
protected getCountryLevelTimeZonesforNumber ( PhoneNumber $number ) : array
$number PhoneNumber PhoneNumber the phone number to look up
Результат array the list of corresponding time zones or a single element list with the default unknown time zone if no other time zone was found

getInstance() публичный статический Метод

The {@link PhoneNumberToTimeZonesMapper} is implemented as a singleton. Therefore, calling this method multiple times will only result in one instance being created.

public static getInstance ( $mappingDir = self::MAPPING_DATA_DIRECTORY ) : PhoneNumberToTimeZonesMapper
$mappingDir
Результат PhoneNumberToTimeZonesMapper instance

getTimeZonesForGeocodableNumber() защищенный Метод

Returns a list of time zones to which a geocodable phone number belongs.
protected getTimeZonesForGeocodableNumber ( PhoneNumber $number ) : array
$number PhoneNumber The phone number for which we want to get the time zones to which it belongs
Результат array the list of correspondiing time zones or a single element list with the default unknown timezone if no other time zone was found or if the number was invalid

getTimeZonesForGeographicalNumber() публичный Метод

This method assumes the validity of the number passed in has already been checked, and that the number is geo-localizable. We consider fixed-line and mobile numbers possible candidates for geo-localization.

public getTimeZonesForGeographicalNumber ( PhoneNumber $number ) : array
$number PhoneNumber PhoneNumber a valid phone number for which we want to get the time zones to which it belongs
Результат array a list of the corresponding time zones or a single element list with the default unknown time zone if no other time zone was found or if the number was invalid

getTimeZonesForNumber() публичный Метод

As per {@link #getTimeZonesForGeographicalNumber(PhoneNumber)} but explicitly checks the validity of the number passed in.
public getTimeZonesForNumber ( PhoneNumber $number ) : array
$number PhoneNumber PhoneNumber the phone number for which we want to get the time zones to which it belongs
Результат array a list of the corresponding time zones or a single element list with the default unknown time zone if no other time zone was found or if the number was invalid

getUnknownTimeZone() публичный статический Метод

Returns a String with the ICU unknown time zone.
public static getUnknownTimeZone ( ) : string
Результат string

loadPrefixTimeZonesMapFromFile() защищенный статический Метод

protected static loadPrefixTimeZonesMapFromFile ( $path )

Описание свойств

$instance защищенное статическое свойство

protected static PhoneNumberToTimeZonesMapper,libphonenumber $instance
Результат PhoneNumberToTimeZonesMapper

$phoneUtil защищенное свойство

protected PhoneNumberUtil,libphonenumber $phoneUtil
Результат PhoneNumberUtil

$prefixTimeZonesMap защищенное свойство

protected $prefixTimeZonesMap

$unknownTimeZoneList защищенное свойство

protected $unknownTimeZoneList