public function MobileNumberUtil::getMobileNumber in Mobile Number 8
Same name and namespace in other branches
- 2.0.x src/MobileNumberUtil.php \Drupal\mobile_number\MobileNumberUtil::getMobileNumber()
Get mobile number object.
Parameters
string $number: Number.
null|string $country: Country.
array $types: Mobile number types to verify as defined in \libphonenumber\PhoneNumberType.
Return value
\libphonenumber\PhoneNumber|null Phone Number object if successful.
Overrides MobileNumberUtilInterface::getMobileNumber
File
- src/
MobileNumberUtil.php, line 108
Class
- MobileNumberUtil
- Turns a render array into a HTML string.
Namespace
Drupal\mobile_numberCode
public function getMobileNumber($number, $country = NULL, $types = [
1 => 1,
2 => 2,
]) {
try {
return $this
->testMobileNumber($number, $country, $types);
} catch (MobileNumberException $e) {
return NULL;
}
}