Core::Model::arbitModelObjectValidator
Class arbitModelObjectValidator
Object validator class
arbitModelValidatorBase
|
--arbitModelObjectValidator
Author(s):
|
Version:
|
$Revision: 1236 $ |
|
License:
|
GPL |
Member Variables
|
protected string |
$className
Name of class, which should be inherited by the object.
Name of class, which should be inherited by the object. |
Method Summary
|
public void |
configure(
[ $className
= null] )
Configure validator
The object validator will optionally take a class name, which causes the passed objects are checked that they inherit from the specified class. |
|
public mixed |
validate(
$name
, $value
, $expectation
)
Validate value
Validates the given input. validation constraints and throws a arbitPropertyValidationException exception otherwise. |
Inherited Methods
Methods
configure
void
configure(
[string
$className
= null] )
Configure validator
The object validator will optionally take a class name, which causes the passed objects are checked that they inherit from the specified class. Configure validator
The object validator will optionally take a class name, which causes the passed objects are checked that they inherit from the specified class.
Parameters:
| Name |
Type |
Description |
$className |
string |
|
Redefinition of:
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.
|
|