contentbox.modules.contentbox-deps.modules.cborm.modules.cbvalidation.models

Interface IValidationManager

contentbox.modules.contentbox-deps.modules.cborm.modules.cbvalidation.models.IValidationManager
All Known Implementing Classes:
ValidationManager
Class Attributes:
None
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.
contentbox.modules.contentbox-deps.modules.cborm.modules.cbvalidation.models.IValidationResult validate(any target, [string fields], [any constraints], [string locale], [string excludeFields])
     Validate an object.

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 contentbox.modules.contentbox-deps.modules.cborm.modules.cbvalidation.models.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.