PHP Класс libphonenumber\ShortNumberUtil

Устаревший: As of release 5.8, replaced by ShortNumberInfo.
Показать файл Открыть проект Примеры использования класса

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

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

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

Метод Описание
__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.

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

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

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

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

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
Результат boolean if the number might be used to connect to an emergency service in the given region.

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

public getSupportedRegions ( )

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

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
Результат boolean if the number exactly matches an emergency services number in the given region.

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

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

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