API Documentation

Validate/Abstract.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Validate
version
$Id: Abstract.php 22473 2010-06-20 08:30:04Z thomas $
Classes
Zend_Validate_Abstract

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Validate_Abstract

Implements
Zend_Validate_Interface
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Validate
Properties
$_value
$_messageVariables
$_messageTemplates
$_messages
$_obscureValue
$_errors
$_translator
$_defaultTranslator
$_translatorDisabled
$_messageLength
Methods
getMessages
getMessageVariables
getMessageTemplates
setMessage
setMessages
__get
_createMessage
_error
_setValue
getErrors
setObscureValue
getObscureValue
setTranslator
getTranslator
hasTranslator
setDefaultTranslator
getDefaultTranslator
hasDefaultTranslator
setDisableTranslator
translatorIsDisabled
getMessageLength
setMessageLength

Description

Properties

$_defaultTranslator

Zend_Translate $_defaultTranslator = ''

Default translation object for all validate objects

Details

$_defaultTranslator
Zend_Translate
visibility
protected
default
final
false
static
true

$_errors

array $_errors = 'array'

Array of validation failure message codes

Details

$_errors
array
visibility
protected
default
array
final
false
static
false
deprecated
Since 1.5.0

$_messageLength

Integer $_messageLength = '1'

Limits the maximum returned length of a error message

Details

$_messageLength
Integer
visibility
protected
default
1
final
false
static
true

$_messageTemplates

array $_messageTemplates = 'array'

Validation failure message template definitions

Details

$_messageTemplates
array
visibility
protected
default
array
final
false
static
false

$_messageVariables

array $_messageVariables = 'array'

Additional variables available for validation failure messages

Details

$_messageVariables
array
visibility
protected
default
array
final
false
static
false

$_messages

array $_messages = 'array'

Array of validation failure messages

Details

$_messages
array
visibility
protected
default
array
final
false
static
false

$_obscureValue

bool $_obscureValue = 'false'

Flag indidcating whether or not value should be obfuscated in error messages

Details

$_obscureValue
bool
visibility
protected
default
false
final
false
static
false

$_translator

Zend_Translate $_translator = ''

Translation object

Details

$_translator
Zend_Translate
visibility
protected
default
final
false
static
false

$_translatorDisabled

Boolean $_translatorDisabled = 'false'

Is translation disabled?

Details

$_translatorDisabled
Boolean
visibility
protected
default
false
final
false
static
false

$_value

mixed $_value = ''

The value to be validated

Details

$_value
mixed
visibility
protected
default
final
false
static
false

Methods

__get

__get( string $property ) : mixed

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

Arguments
$property
string
Output
mixed
Details
visibility
public
final
false
static
false
throws

_createMessage

_createMessage( string $messageKey, string $value ) : string

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.

Arguments
$messageKey
string
$value
string
Output
string
Details
visibility
protected
final
false
static
false

_error

_error( string $messageKey, string $value = null ) : void

Arguments
$messageKey
string
$value
string
OPTIONAL
Details
visibility
protected
final
false
static
false

_setValue

_setValue( mixed $value ) : void

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

Arguments
$value
mixed
Details
visibility
protected
final
false
static
false

getDefaultTranslator

getDefaultTranslator( ) : Zend_Translate_Adapter|null

Get default translation object for all validate objects

Details
visibility
public
final
false
static
true

getErrors

getErrors( ) : array

Returns array of validation failure message codes

Output
array
Details
visibility
public
final
false
static
false
deprecated
Since 1.5.0

getMessageLength

getMessageLength( ) : integer

Returns the maximum allowed message length

Output
integer
Details
visibility
public
final
false
static
true

getMessageTemplates

getMessageTemplates( ) : array

Returns the message templates from the validator

Output
array
Details
visibility
public
final
false
static
false

getMessageVariables

getMessageVariables( ) : array

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

Output
array
Details
visibility
public
final
false
static
false

getMessages

getMessages( ) : array

Returns array of validation failure messages

Output
array
Details
visibility
public
final
false
static
false

getObscureValue

getObscureValue( ) : bool

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

Output
bool
Details
visibility
public
final
false
static
false

getTranslator

getTranslator( ) : Zend_Translate_Adapter|null

Return translation object

Details
visibility
public
final
false
static
false

hasDefaultTranslator

hasDefaultTranslator( ) : boolean

Is there a default translation object set?

Output
boolean
Details
visibility
public
final
false
static
true

hasTranslator

hasTranslator( ) : bool

Does this validator have its own specific translator?

Output
bool
Details
visibility
public
final
false
static
false

setDefaultTranslator

setDefaultTranslator( Zend_Translate|Zend_Translate_Adapter|null $translator = null ) : void

Set default translation object for all validate objects

Arguments
$translator
Zend_TranslateZend_Translate_Adapternull
Details
visibility
public
final
false
static
true

setDisableTranslator

setDisableTranslator( bool $flag ) : Zend_Validate_Abstract

Indicate whether or not translation should be disabled

Arguments
$flag
bool
Details
visibility
public
final
false
static
false

setMessage

setMessage( string $messageString, string $messageKey = null ) : Zend_Validate_Abstract

Sets the validation failure message template for a particular key

Arguments
$messageString
string
$messageKey
string
OPTIONAL
Output
Zend_Validate_Abstract
Provides a fluent interface
Details
visibility
public
final
false
static
false
throws

setMessageLength

setMessageLength( integer $length = 1 ) :

Sets the maximum allowed message length

Arguments
$length
integer
Details
visibility
public
final
false
static
true

setMessages

setMessages( array $messages ) : Zend_Validate_Abstract

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.

Arguments
$messages
array
Details
visibility
public
final
false
static
false

setObscureValue

setObscureValue( bool $flag ) : Zend_Validate_Abstract

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

Arguments
$flag
bool
Details
visibility
public
final
false
static
false

setTranslator

setTranslator( Zend_Translate|Zend_Translate_Adapter|null $translator = null ) : Zend_Validate_Abstract

Set translation object

Arguments
$translator
Zend_TranslateZend_Translate_Adapternull
Details
visibility
public
final
false
static
false

translatorIsDisabled

translatorIsDisabled( ) : bool

Is translation disabled?

Output
bool
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.