library/Dot/Validate/Phone.php
Properties
Description
DotBoost Technologies Inc.
DotKernel Application Framework
Classes
Dot_Validate_Phone
Properties
No
No
Description
Validate Phone Number
Methods
__construct,
getArea,
getData,
getError,
getPrefix,
isValid,
__construct(
array
$options
= array,
)
:
Dot_Validate_Phone
Description
Construct that receive as parameters the phone number and some options as array
Arguments
Name |
Type |
Description |
Default |
$options |
array |
[optional] |
array |
Return value
Tags
Name |
Description |
access |
public |
getArea(
string
$phone,
)
:
string
Description
Return phone area.
If no param set when calling this method, get phone area from isValid() method
Arguments
Name |
Type |
Description |
Default |
$phone |
string |
[optional] |
|
Return value
getData(
)
:
array
Description
Get valid data
Return value
Tags
Name |
Description |
access |
public |
getError(
)
:
array
Description
Get errors encounter on validation
Return value
Tags
Name |
Description |
access |
public |
getPrefix(
string
$phone,
)
:
string
Description
Return phone prefix.
If no param set when calling this method, get phone prefix from isValid() method
Arguments
Name |
Type |
Description |
Default |
$phone |
string |
[optional] |
|
Return value
isValid(
)
:
bool
Description
Validate phone number by country code
Return value
Tags
Name |
Description |
access |
public |
Properties
$_area,
$_countryCode,
$_data,
$_error,
$_options,
$_prefix,
$_value,
private
$_area
=
Phone areastring
private
$_countryCode
=
US
Country code for which the phone should be validatestring
private
$_data
=
array
Valid data after validationarray
private
$_error
=
array
Errors found on validationarray
private
$_options
=
array
Phone optionsarray
private
$_prefix
=
Phone prefixstring
private
$_value
=
Value of the phone to be validatestring