Abstract supertype for validators. Implements the validate interface and provides additional methods and options for templated error messages and translation support.
This class should be extended into the specific validate class.
To use translation, pass a configured instance of translateManager to the constructor of the validator.
public __construct([$inOptions = array()], [$inTranslateManager = null])
Creates a new validator instance, validator is initialised after options are set
public abstract initialise()
Performs validator initialisation including customisation of template messages etc.
public reset()
Resets the object
public getMessageTemplate($inTemplateKey)
Returns the message template corresponding to $inTemplateKey
public addMessageTemplates($inTemplateKey, $inMessageTemplate)
Adds a new message template for key $inTemplateKey
protected _formatMessage($inTemplateKey, $inValue)
Formats an error message replacing keys with data
public getMessageVariables()
Returns $_MessageVariables
public addMessageVariable($inIdentifier, $inValue)
Adds a message variable, $inValue should be either a string or number
public addMessage($inMessage)
Adds the message to the stack
public getOptionsSet()
Returns the options set
public getValue()
Returns $_Value
public setValue($inValue)
Set $_Value to $inValue
public getTranslationManager()
Returns the translation manager, or null if not set
public setTranslationManager($inManager)
Sets the translation manager for use with validators
Tags: utility, utilityvalidateabstract, utilityvalidateinterface,
utility Articles