Documentation

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_PATTERN

public mixed INTERNATIONAL_PATTERN = "/^\\+(?:[0-9] ?){6,14}[0-9]\$/"

US_PATTERN

public mixed US_PATTERN = "/^[0-9]{3}-[0-9]{3}-[0-9]{4}\$/"

Properties

Methods

isValid()

Returns true if validation is successful

public isValid(mixed $data) : bool
Parameters
$data : mixed
Return values
bool

validate()

public validate(mixed $data) : bool
Parameters
$data : mixed
Return values
bool

        
On this page

Search results