coldbox.system.validation

Interface IValidationManager

WEB-INF.cftags.interface
        extended by coldbox.system.validation.IValidationManager
Class Attributes:
None
All Known Implementing Classes:
ValidationManager
Method Summary
IValidationManager addSharedConstraint(string name, struct constraint)
     Store a shared constraint.
struct getSharedConstraints([string name])
     Retrieve the shared constraints.
IValidationManager setSharedConstraints([struct constraints])
     Set the shared constraints into the validation manager, usually these are described in the ColdBox configuraiton file.
boolean sharedConstraintsExists(string name)
     Check if a shared constraint exists by name.
coldbox.system.validation.IValidationResult validate(any target, [string fields], [any constraints], [string locale=''], [string excludeFields=''])
     Validate an object.
 
Methods inherited from class WEB-INF.cftags.interface
None

Method Detail

addSharedConstraint

public IValidationManager addSharedConstraint(string name, struct constraint)

Store a shared constraint

Parameters:
name - Filter by name or not
constraint - The constraint to store.

getSharedConstraints

public struct getSharedConstraints([string name])

Retrieve the shared constraints

Parameters:
name - Filter by name or not

setSharedConstraints

public IValidationManager setSharedConstraints([struct constraints])

Set the shared constraints into the validation manager, usually these are described in the ColdBox configuraiton file

Parameters:
constraints - Filter by name or not

sharedConstraintsExists

public boolean sharedConstraintsExists(string name)

Check if a shared constraint exists by name

Parameters:
name - The shared constraint to check

validate

public coldbox.system.validation.IValidationResult validate(any target, [string fields], [any constraints], [string locale=''], [string excludeFields=''])

Validate an object

Parameters:
target - The target object to validate
fields - One or more fields to validate on, by default it validates all fields in the constraints. This can be a simple list or an array.
constraints - An optional shared constraints name or an actual structure of constraints to validate on.
locale - An optional locale to use for i18n messages
excludeFields - An optional list of fields to exclude from the validation.