interface PolyTypeObjectValidatorInterface implements ObjectValidatorInterface (View source)

Contract for a poly type validator, able to act on possibly any type.

Methods

validate(mixed $value)

Checks if the given value is valid according to the validator, and returns the Error Messages object which occurred.

array
getOptions()

Returns the options of this validator which can be specified in the constructor

void
setValidatedInstancesContainer(SplObjectStorage $validatedInstancesContainer)

Allows to set a container to keep track of validated instances.

bool
canValidate(mixed $target)

Checks the given target can be validated by the validator implementation.

int
getPriority()

Return the priority of this validator.

Details

Result validate(mixed $value)

Checks if the given value is valid according to the validator, and returns the Error Messages object which occurred.

Parameters

mixed $value

The value that should be validated

Return Value

Result

array getOptions()

Returns the options of this validator which can be specified in the constructor

Return Value

array

void setValidatedInstancesContainer(SplObjectStorage $validatedInstancesContainer)

Allows to set a container to keep track of validated instances.

Parameters

SplObjectStorage $validatedInstancesContainer

A container to keep track of validated instances

Return Value

void

bool canValidate(mixed $target)

Checks the given target can be validated by the validator implementation.

Parameters

mixed $target

The object or class name to be checked

Return Value

bool

true if the target can be validated

int getPriority()

Return the priority of this validator.

Validators with a high priority are chosen before low priority and only one of multiple capable validators will be used.

Return Value

int