Detailed Description

parent validator class

Basic validator. ContaŃ–ns validator factory.

Definition at line 14 of file validator.php.

Inheritance diagram for validator:

Public Member Functions

 __construct ($log=null)
 validator constructor More...
 
 validate ($value, $parameters=array())
 default validator. More...
 
 getPatternAttribute ()
 returns validators' regular expression as HTML5 pattern attribute More...
 

Static Public Member Functions

static factory ($argument, $log=null)
 valdiator object factory More...
 
static isValid ($input)
 

Protected Member Functions

 log ($argument, $type)
 error logging method More...
 

Protected Attributes

 $log
 log object More...
 

Constructor & Destructor Documentation

__construct (   $log = null)

validator constructor

Attaches error logging object to validator.

Parameters
object$logerror logging object
Returns
void

Definition at line 29 of file validator.php.

Member Function Documentation

static factory (   $argument,
  $log = null 
)
static

valdiator object factory

Static validator object factory. Picks validator type depending on $argument.

Parameters
string$argumentvalidator type or regular expression or closure
object$logerror logging object
Returns
object validator object

Definition at line 44 of file validator.php.

getPatternAttribute ( )

returns validators' regular expression as HTML5 pattern attribute

Returns
string HTML pattern attribute

Definition at line 102 of file validator.php.

static isValid (   $input)
static

Returns a bool value indicating whether or not the input passes the given element's validation criteria.

Returns
bool isValid

Definition at line 115 of file validator.php.

log (   $argument,
  $type 
)
protected

error logging method

Parameters
string$argumenterror message
string$typeerror type
Returns
void

Definition at line 88 of file validator.php.

validate (   $value,
  $parameters = array() 
)

default validator.

Everything is valid. To be overriden in specific validator objects.

Parameters
mixed$valuevalue to be validated
array$parametersvalidation parameters
Returns
bool validation result

Definition at line 76 of file validator.php.

Field Documentation

$log
protected

log object

Definition at line 19 of file validator.php.


The documentation for this class was generated from the following file: