Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

Zend_Validate_Abstract Class Reference

Inheritance diagram for Zend_Validate_Abstract:
Zend_Validate_Interface Zend_Validate_Alnum Zend_Validate_Alpha Zend_Validate_Barcode Zend_Validate_Barcode_Ean13 Zend_Validate_Barcode_UpcA Zend_Validate_Between Zend_Validate_Ccnum Zend_Validate_Date Zend_Validate_Db_Abstract Zend_Validate_Digits Zend_Validate_EmailAddress Zend_Validate_File_Count Zend_Validate_File_Exists Zend_Validate_File_Extension Zend_Validate_File_Hash Zend_Validate_File_ImageSize Zend_Validate_File_MimeType Zend_Validate_File_Size Zend_Validate_File_Upload Zend_Validate_Float Zend_Validate_GreaterThan Zend_Validate_Hex Zend_Validate_Hostname Zend_Validate_Iban Zend_Validate_Identical Zend_Validate_InArray Zend_Validate_Int Zend_Validate_Ip Zend_Validate_LessThan Zend_Validate_NotEmpty Zend_Validate_Regex Zend_Validate_Sitemap_Changefreq Zend_Validate_Sitemap_Lastmod Zend_Validate_Sitemap_Loc Zend_Validate_Sitemap_Priority Zend_Validate_StringLength

Public Member Functions

 getMessages ()
 getMessageVariables ()
 getMessageTemplates ()
 setMessage ($messageString, $messageKey=null)
 setMessages (array $messages)
 __get ($property)
 getErrors ()
 setObscureValue ($flag)
 getObscureValue ()
 setTranslator ($translator=null)
 getTranslator ()
 setDisableTranslator ($flag)
 translatorIsDisabled ()

Static Public Member Functions

static setDefaultTranslator ($translator=null)
static getDefaultTranslator ()
static getMessageLength ()
static setMessageLength ($length=-1)

Protected Member Functions

 _createMessage ($messageKey, $value)
 _error ($messageKey=null, $value=null)
 _setValue ($value)

Protected Attributes

 $_value
 $_messageVariables = array()
 $_messageTemplates = array()
 $_messages = array()
 $_obscureValue = false
 $_errors = array()
 $_translator
 $_translatorDisabled = false

Static Protected Attributes

static $_defaultTranslator
static $_messageLength = -1

Detailed Description

Definition at line 33 of file Abstract.php.


Member Function Documentation

__get ( property )

Magic function returns the value of the requested property, if and only if it is the value or a message variable.

Parameters:
string$property
Returns:
mixed
Exceptions:
Zend_Validate_Exception

See also:
Zend_Validate_Exception

Definition at line 183 of file Abstract.php.

_createMessage ( messageKey,
value 
) [protected]

Constructs and returns a validation failure message with the given message key and value.

Returns null if and only if $messageKey does not correspond to an existing template.

If a translator is available and a translation exists for $messageKey, the translation will be used.

Parameters:
string$messageKey
string$value
Returns:
string

Definition at line 210 of file Abstract.php.

_error ( messageKey = null,
value = null 
) [protected]
Parameters:
string$messageKeyOPTIONAL
string$valueOPTIONAL
Returns:
void

Definition at line 258 of file Abstract.php.

_setValue ( value ) [protected]

Sets the value to be validated and clears the messages and errors arrays

Parameters:
mixed$value
Returns:
void

Definition at line 277 of file Abstract.php.

static getDefaultTranslator (  ) [static]

Get default translation object for all validate objects

Returns:
Zend_Translate_Adapter|null

Definition at line 378 of file Abstract.php.

getErrors (  )

Returns array of validation failure message codes

Returns:
array
Deprecated:
Since 1.5.0

Implements Zend_Validate_Interface.

Definition at line 290 of file Abstract.php.

static getMessageLength (  ) [static]

Returns the maximum allowed message length

Returns:
integer

Definition at line 422 of file Abstract.php.

getMessages (  )

Returns array of validation failure messages

Returns:
array

Implements Zend_Validate_Interface.

Definition at line 108 of file Abstract.php.

getMessageTemplates (  )

Returns the message templates from the validator

Returns:
array

Definition at line 128 of file Abstract.php.

getMessageVariables (  )

Returns an array of the names of variables that are used in constructing validation failure messages

Returns:
array

Definition at line 118 of file Abstract.php.

getObscureValue (  )

Retrieve flag indicating whether or not value should be obfuscated in messages

Returns:
bool

Definition at line 313 of file Abstract.php.

getTranslator (  )

Return translation object

Returns:
Zend_Translate_Adapter|null

Definition at line 342 of file Abstract.php.

static setDefaultTranslator ( translator = null ) [static]

Set default translation object for all validate objects

Parameters:
Zend_Translate | Zend_Translate_Adapter | null$translator
Returns:
void

Definition at line 361 of file Abstract.php.

setDisableTranslator ( flag )

Indicate whether or not translation should be disabled

Parameters:
bool$flag
Returns:
Zend_Validate_Abstract

Definition at line 401 of file Abstract.php.

setMessage ( messageString,
messageKey = null 
)

Sets the validation failure message template for a particular key

Parameters:
string$messageString
string$messageKeyOPTIONAL
Returns:
Zend_Validate_Abstract Provides a fluent interface
Exceptions:
Zend_Validate_Exception

Definition at line 141 of file Abstract.php.

static setMessageLength ( length = -1 ) [static]

Sets the maximum allowed message length

Parameters:
integer$length

Definition at line 432 of file Abstract.php.

setMessages ( array $  messages )

Sets validation failure message templates given as an array, where the array keys are the message keys, and the array values are the message template strings.

Parameters:
array$messages
Returns:
Zend_Validate_Abstract

Definition at line 167 of file Abstract.php.

setObscureValue ( flag )

Set flag indicating whether or not value should be obfuscated in messages

Parameters:
bool$flag
Returns:
Zend_Validate_Abstract

Definition at line 301 of file Abstract.php.

setTranslator ( translator = null )

Set translation object

Parameters:
Zend_Translate | Zend_Translate_Adapter | null$translator
Returns:
Zend_Validate_Abstract

Definition at line 324 of file Abstract.php.

translatorIsDisabled (  )

Is translation disabled?

Returns:
bool

Definition at line 412 of file Abstract.php.


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