Stores a list of all the validation error or warning messages that have happened since the validation manager was created or since the last reset was performed.
Each message is stored with its associated tag.
Stores the current validation state for each one of the defined tags.
tag contains the name of the tag for which we are saving the status status can have 3 different values: OK / WARNING / ERROR
Constant that defines the error validation status
Constant that defines the correct validation status
Constant that defines the warning validation status
Update the class validation Status depending on the provided error message.
the result of the validation
The error message that's been generated from a previously executed validation method
The tag or list of tags that have been defiend for the validation value
Tells if the validation fail will be processed as a validation error or a validation warning
True if received errorMessage was '' (validation passed) or false if some error message was received (validation failed)
Find the first error or warning message that happened since the validation manager was instantiated or since the last reset
The first error or warning message or empty string if no message exists
Find the latest error or warning message that happened since the validation manager was instantiated or since the last reset
The last error or warning message or empty string if no message exists
Check the current validation state. Possible return values are ValidationManager.OK, ValidationManager.WARNING or ValidationManager.ERROR
If we want to check the validation state for a specific tag or a list of tags, we can set it here. If we want to get the global validation state for all the tags we will leave this value empty ''.
ValidationManager.OK, ValidationManager.WARNING or ValidationManager.ERROR
Validation will fail if specified value is not an array
The array to validate
The error message that will be generated if validation fails
We can define a tag name or list of tags to group the validation results. We can use this tags later to filter validation state
Tells if the validation fail will be processed as a validation error or a validation warning
False in case the validation fails or true if validation succeeds.
Validation will fail if specified value is not a boolean
The boolean to validate
The error message that will be generated if validation fails
We can define a tag name or list of tags to group the validation results. We can use this tags later to filter validation state
Tells if the validation fail will be processed as a validation error or a validation warning
False in case the validation fails or true if validation succeeds.
Validation will fail if specified elements are not identical.
First of the two objects to compare. Almost any type can be provided: ints, strings, arrays...
Second of the two objects to compare. Almost any type can be provided: ints, strings, arrays...
The error message that will be generated if validation fails
We can define a tag name or list of tags to group the validation results. We can use this tags later to filter validation state
Tells if the validation fail will be processed as a validation error or a validation warning
False in case the validation fails or true if validation succeeds.
Validation will fail if specified text is empty.
See Stringutils.isEmpty to understand what is considered as an empty text
A text that must not be empty.
Optional array containing a list of string values that will be considered as empty for the given string. This can be useful in some cases when we want to consider a string like 'NULL' as an empty string.
The error message that will be generated if validation fails
We can define a tag name or list of tags to group the validation results. We can use this tags later to filter validation state
Tells if the validation fail will be processed as a validation error or a validation warning
False in case the validation fails or true if validation succeeds.
Validation will fail if specified value is not numeric
The number to validate
The error message that will be generated if validation fails
We can define a tag name or list of tags to group the validation results. We can use this tags later to filter validation state
Tells if the validation fail will be processed as a validation error or a validation warning
False in case the validation fails or true if validation succeeds.
Validation will fail if specified value is not numeric and between the two provided values.
The number to validate
The minimum accepted value (included)
The maximum accepted value (included)
The error message that will be generated if validation fails
We can define a tag name or list of tags to group the validation results. We can use this tags later to filter validation state
Tells if the validation fail will be processed as a validation error or a validation warning
False in case the validation fails or true if validation succeeds.
Validation will fail if specified value is not an object
The object to validate
The error message that will be generated if validation fails
We can define a tag name or list of tags to group the validation results. We can use this tags later to filter validation state
Tells if the validation fail will be processed as a validation error or a validation warning
False in case the validation fails or true if validation succeeds.
TODO - translate from PHP
Validation will fail if specified value is not a string
The error message that will be generated if validation fails
We can define a tag name or list of tags to group the validation results. We can use this tags later to filter validation state
Tells if the validation fail will be processed as a validation error or a validation warning
False in case the validation fails or true if validation succeeds.
Validation will fail if specified value is not a true boolean value
A boolean expression to validate
The error message that will be generated if validation fails
We can define a tag name or list of tags to group the validation results. We can use this tags later to filter validation state
Tells if the validation fail will be processed as a validation error or a validation warning
False in case the validation fails or true if validation succeeds.
Validation will fail if specified value is not an url
The element to validate
The error message that will be generated if validation fails
We can define a tag name or list of tags to group the validation results. We can use this tags later to filter validation state
Tells if the validation fail will be processed as a validation error or a validation warning
False in case the validation fails or true if validation succeeds.
Provides a way to perform a fast validation check. Will return true if validation manager is in a warning or error state, or false if validation state is ok.
If we want to check the validation state for a specific tag or a list of tags, we can set it here. If we want to get the global validation state for all the tags we will leave this value empty ''.
True if status is warning or error, False if status is ok
Provides a way to perform a fast validation check. Will return true if validation state is ok, or false if validation manager is in a warning or error state.
If we want to check the validation state for a specific tag or a list of tags, we can set it here. If we want to get the global validation state for all the tags we will leave this value empty ''.
True if status is ok, false if status is warning or error
Reinitialize the validation status.
This is normally called at the beginning of every global validation we perform. It will reset all the validation errors on this class and for all tags, so we can re validate whatever we need to.
void
Generated using TypeDoc
Class that allows us to manage application validation in an encapsulated way. We can create as many instances as we want, and each instance will store the validation history and global validation state, so we can use this class to validate complex forms or multiple elements globally. We can also use tags to sandbox different validation elements or groups togheter.