PHP Class libphonenumber\PhoneNumberToTimeZonesMapper

Afficher le fichier Open project: giggsey/libphonenumber-for-php Class Usage Examples

Protected Properties

Свойство Type Description
$instance PhoneNumberToTimeZonesMapper
$phoneUtil PhoneNumberUtil
$prefixTimeZonesMap
$unknownTimeZoneList

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
__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 )

Method Details

__construct() protected méthode

protected __construct ( $phonePrefixDataDirectory )

getCountryLevelTimeZonesforNumber() protected méthode

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
Résultat 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() public static méthode

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
Résultat PhoneNumberToTimeZonesMapper instance

getTimeZonesForGeocodableNumber() protected méthode

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
Résultat 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() public méthode

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
Résultat 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() public méthode

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
Résultat 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() public static méthode

Returns a String with the ICU unknown time zone.
public static getUnknownTimeZone ( ) : string
Résultat string

loadPrefixTimeZonesMapFromFile() protected static méthode

protected static loadPrefixTimeZonesMapFromFile ( $path )

Property Details

$instance protected_oe static_oe property

protected static PhoneNumberToTimeZonesMapper,libphonenumber $instance
Résultat PhoneNumberToTimeZonesMapper

$phoneUtil protected_oe property

protected PhoneNumberUtil,libphonenumber $phoneUtil
Résultat PhoneNumberUtil

$prefixTimeZonesMap protected_oe property

protected $prefixTimeZonesMap

$unknownTimeZoneList protected_oe property

protected $unknownTimeZoneList