validate()

Overview

public ValidationResult function validate(
      required string  ruleset        
    , required struct  data           
    ,          any     result         
    ,          boolean ignoreMissing   = false
    ,          string  fieldNamePrefix = ""
    ,          string  fieldNameSuffix = ""
    ,          array   suppressFields 
)

Validates the passed data struct against a registered ruleset. Returns a Validation result object that contains validation result information. See Validation framework for full usage documentation.

Arguments

NameTypeRequiredDescription
rulesetstringYesName of the ruleset to validate against
datastructYesThe data set to validate
resultanyNoOptional existing validation result to which to append validation errors
ignoreMissingbooleanNo (default=false)Whether or not to ignore fields that are entirely missing from the passed data
fieldNamePrefixstringNo (default="")Prefix to add to fieldnames in error messages
fieldNameSuffixstringNo (default="")Suffix to add to fieldnames in error messages
suppressFieldsarrayNo