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
| Name | Type | Required | Description |
|---|---|---|---|
| ruleset | string | Yes | Name of the ruleset to validate against |
| data | struct | Yes | The data set to validate |
| result | any | No | Optional existing validation result to which to append validation errors |
| ignoreMissing | boolean | No (default=false) | Whether or not to ignore fields that are entirely missing from the passed data |
| fieldNamePrefix | string | No (default="") | Prefix to add to fieldnames in error messages |
| fieldNameSuffix | string | No (default="") | Suffix to add to fieldnames in error messages |
| suppressFields | array | No |