spunQ_FieldValidator Class Reference

Field validator parent providing some default implementations. More...

Inheritance diagram for spunQ_FieldValidator:

spunQ_IFieldValidator spunQ_ArrayLengthValidator spunQ_CheckedValidator spunQ_NotNullValidator spunQ_StringLengthValidator

List of all members.

Public Member Functions

 showJsValidationString ($typePath, $messagePrefix)
 Prints javascript for this validator.
 validate ($messagePrefix, $value)
 Does the validation.

Protected Member Functions

 __construct ($messageKey)
 Constructor.

Protected Attributes

 $messageKey
 Translation key for the error message.


Detailed Description

Field validator parent providing some default implementations.

Provides a message key for translations and states that it cannot generate validation js by default.

Definition at line 8 of file FieldValidator.class.php.


Constructor & Destructor Documentation

spunQ_FieldValidator::__construct ( messageKey  )  [protected]

Constructor.

Parameters:
$messageKey Translation key for the error message to be displayed if the value is invalid.

Reimplemented in spunQ_CheckedValidator, and spunQ_NotNullValidator.

Definition at line 21 of file FieldValidator.class.php.


Member Function Documentation

spunQ_FieldValidator::showJsValidationString ( typePath,
messagePrefix 
)

Prints javascript for this validator.

Should make use a call to the spunQ javascript function spunQ.form.registerValidator().

Parameters:
$messagePrefix A string to prepend to the error message key.
Returns:
boolean Whether any validation javascript was displayed.

Implements spunQ_IFieldValidator.

Reimplemented in spunQ_StringLengthValidator.

Definition at line 29 of file FieldValidator.class.php.

spunQ_IFieldValidator::validate ( messagePrefix,
value 
) [inherited]

Does the validation.

Parameters:
$messagePrefix A string to prepend to the error message key.
$value The spunQ value to validate.
Returns:
string Error message for the validated field, or NULL if the value was valid.

Implemented in spunQ_ArrayLengthValidator, spunQ_CheckedValidator, spunQ_DateRangeValidator, spunQ_EmailSyntaxValidator, spunQ_NotNullValidator, spunQ_StringLengthValidator, spunQ_UniqueMemberValidator, and spunQ_UrlSyntaxValidator.


Member Data Documentation

spunQ_FieldValidator::$messageKey [protected]

Translation key for the error message.

Type:
string

Definition at line 14 of file FieldValidator.class.php.


The documentation for this class was generated from the following file:

Generated on Fri Jul 1 11:12:40 2011 for spunQ3 by  doxygen 1.5.9