\phpWTLGenericDataValidator

Generic data validator.

Summary

Methods
Properties
Constants
validate()
isValid()
getInstance()
No public properties found
No constants found
__construct()
__clone()
__sleep()
__wakeup()
$loggerContent
$fieldDescriptor
$_instance
N/A
No private methods found
No private properties found
N/A

Properties

$loggerContent

$loggerContent : 

Type

$fieldDescriptor

$fieldDescriptor : 

Type

$_instance

$_instance : 

Array to hold instances of all derived classes.

Type

Methods

validate()

validate() : array

Validate all log fields.

Returns

array —

Validation errors (contains field names which did not validate), null if none

isValid()

isValid(string  $field_name, string  $value = null) : boolean

Validate data for a single log field.

Parameters

string $field_name

ID of log format field.

string $value

Provide an (optional) value to validate, so allowing for the validation of external data (by default validation will be performed on the LoggerContent object).

Returns

boolean —

Field valid?.

getInstance()

getInstance(array|mixed|null  $inject = null) : \phpWTL\$_instance[$class]

Create new instance or give back already existing one.

Parameters

array|mixed|null $inject

Can be used to inject one or more parameter(s) into the constructor

Returns

\phpWTL\$_instance[$class] —

The instance of a derived class

__construct()

__construct(object|null  $inject = null) 

Constructor stump.

Parameters

object|null $inject

Can be used to inject one or more parameter(s) into the constructor.

__clone()

__clone() 

Disable cloning for singleton.

Throws

\phpWTL\Exception

if called

__sleep()

__sleep() 

Disable serialization for singleton.

Throws

\phpWTL\Exception

if called

__wakeup()

__wakeup() 

Disable de-serialization for singleton.

Throws

\phpWTL\Exception

if called