Validation
Validation Functions
/**
* Validate the ActiveEntity with the coded constraints -> this.constraints, or passed in shared or implicit constraints
* The entity must have been populated with data before the validation
*
* @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.
*/
boolean function isValid(
string fields="*",
any constraints="",
string locale="",
string excludeFields=""
){
/**
* Get the validation results object. This will be an empty validation object if isValid() has not being called yet.
*/
cbvalidation.models.result.IValidationResult function getValidationResults(){Declaring Constraints
Validating Constraints
Displaying Errors
Unique Property Validation
Last updated
Was this helpful?