PhoneNumber
extends Base
in package
Requires a valid phone number format nnn-nnn-nnnn
Table of Contents
Constants
- INTERNATIONAL = 20
- INTERNATIONAL_PATTERN = "/^\\+(?:[0-9] ?){6,14}[0-9]\$/"
- US = 10
- US_PATTERN = "/^[0-9]{3}-[0-9]{3}-[0-9]{4}\$/"
Properties
- $_Type : mixed
Methods
- __construct() : mixed
- getType() : int
- isValid() : bool
- Returns true if validation is successful
- setType() : PhoneNumber
- validate() : bool
Constants
INTERNATIONAL
public
mixed
INTERNATIONAL
= 20
INTERNATIONAL_PATTERN
public
mixed
INTERNATIONAL_PATTERN
= "/^\\+(?:[0-9] ?){6,14}[0-9]\$/"
US
public
mixed
US
= 10
US_PATTERN
public
mixed
US_PATTERN
= "/^[0-9]{3}-[0-9]{3}-[0-9]{4}\$/"
Properties
$_Type
public
mixed
$_Type
Methods
__construct()
public
__construct() : mixed
getType()
public
getType() : int
Return values
intisValid()
Returns true if validation is successful
public
isValid(mixed $data) : bool
Parameters
- $data : mixed
Return values
boolsetType()
public
setType(int $Type) : PhoneNumber
Parameters
- $Type : int
Return values
PhoneNumbervalidate()
public
validate(mixed $data) : bool
Parameters
- $data : mixed