PHP Class libphonenumber\ShortNumberUtil

Deprecation: As of release 5.8, replaced by ShortNumberInfo.
Afficher le fichier Open project: giggsey/libphonenumber-for-php Class Usage Examples

Protected Properties

Свойство Type Description
$phoneUtil PhoneNumberUtil

Méthodes publiques

Méthode Description
__construct ( PhoneNumberUtil $phoneNumberUtil = null )
connectsToEmergencyNumber ( $number, $regionCode ) : boolean Returns true if the number might be used to connect to an emergency service in the given region.
getSupportedRegions ( )
isEmergencyNumber ( $number, $regionCode ) : boolean Returns true if the number exactly matches an emergency service number in the given region.

Method Details

__construct() public méthode

public __construct ( PhoneNumberUtil $phoneNumberUtil = null )
$phoneNumberUtil PhoneNumberUtil

connectsToEmergencyNumber() public méthode

This method takes into account cases where the number might contain formatting, or might have additional digits appended (when it is okay to do that in the region specified).
public connectsToEmergencyNumber ( $number, $regionCode ) : boolean
$number String the phone number to test
$regionCode String the region where the phone number is being dialed
Résultat boolean if the number might be used to connect to an emergency service in the given region.

getSupportedRegions() public méthode

public getSupportedRegions ( )

isEmergencyNumber() public méthode

This method takes into account cases where the number might contain formatting, but doesn't allow additional digits to be appended.
public isEmergencyNumber ( $number, $regionCode ) : boolean
$number String The phone number to test
$regionCode String The region where the phone number is being dialed
Résultat boolean if the number exactly matches an emergency services number in the given region.

Property Details

$phoneUtil protected_oe property

protected PhoneNumberUtil,libphonenumber $phoneUtil
Résultat PhoneNumberUtil