Arbit - project tracking

Arbit - project tracking

API documentation :: Docs For Class arbitModelArrayValidator

Core::Model::arbitModelArrayValidator

Class arbitModelArrayValidator

Array validator class

Array validator class

arbitModelValidatorBase
   |
   --arbitModelArrayValidator
Author(s):
Version:   $Revision: 1236 $
License:   GPL

Member Variables

protected arbitModelValidatorBase $keyValidator = null
Validator for the array keys.

Validator for the array keys.

protected arbitModelValidatorBase $valueValidator = null
Validator for the array values.

Validator for the array values.

Method Summary

public void configure( [ $keyValidator = null] , [ $valueValidator = null] )
Configure validator The array validator may optionally be configured with an additional validator, which is applied to all array values. validator class no assumptions will be made on the array values.
public mixed validate( $name , $value , $expectation )
Validate value Validates the given input. validation constraints and throws a arbitPropertyValidationException exception otherwise.

Inherited Methods

From arbitModelValidatorBase
public void arbitModelValidatorBase::configure()
Configure validator Method to configure the validator, if it requires configuration at all.
public static void arbitModelValidatorBase::create()
Create validator.
public abstract mixed arbitModelValidatorBase::validate()
Validate value Validates the given input. validation constraints and throws a arbitPropertyValidationException exception otherwise.

Methods

configure

void configure( [arbitModelValidatorBase $keyValidator = null] , [arbitModelValidatorBase $valueValidator = null] )

Configure validator The array validator may optionally be configured with an additional validator, which is applied to all array values. validator class no assumptions will be made on the array values.

Configure validator The array validator may optionally be configured with an additional validator, which is applied to all array values. If you do not pass a validator class no assumptions will be made on the array values.

Parameters:
Name Type Description
$keyValidator arbitModelValidatorBase
$valueValidator arbitModelValidatorBase
Redefinition of:
Method Description
arbitModelValidatorBase::configure() Configure validator Method to configure the validator, if it requires configuration at all.

validate

mixed validate( string $name , mixed $value , string $expectation )

Validate value Validates the given input. validation constraints and throws a arbitPropertyValidationException exception otherwise.

Validate value Validates the given input. Returns the input, when it matches the validation constraints and throws a arbitPropertyValidationException exception otherwise. The name and expectation paramters are used to generate a better user error message. The name should be the name of the property, and the expectation should be a string somehow describing what kind of content was expected from validation.

Parameters:
Name Type Description
$name string
$value mixed
$expectation string
Exceptions:
Type Description
arbitPropertyValue If validation constraints are not met.
Redefinition of:
Method Description
arbitModelValidatorBase::validate() Validate value Validates the given input. validation constraints and throws a arbitPropertyValidationException exception otherwise.
Documentation generated on Mon, 05 Apr 2010 14:01:35 +0200 by phpDocumentor 1.4.3