API Documentation

Zend/Validate/Abstract.php

Show: inherited
Table of Contents

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.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Validate  
Version
$Id: Abstract.php 24807 2012-05-15 12:10:42Z adamlundrigan $  

\Zend_Validate_Abstract

Package: Zend\Validate

Implements
\Zend_Validate_Interface
Children
\Zend_Validate_Ip
\Zend_Validate_Hostname
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

Propertyprotected\Zend_Translate  $_defaultTranslator= ''
static

Default translation object for all validate objects

Details
Type
\Zend_Translate
Propertyprotectedarray  $_errors= 'array()'

Array of validation failure message codes

Default valuearray()Details
Type
array
Deprecated
Since 1.5.0  
PropertyprotectedInteger  $_messageLength= '-1'
static

Limits the maximum returned length of a error message

Default value-1Details
Type
Integer
Propertyprotectedarray  $_messageTemplates= 'array()'

Validation failure message template definitions

Default valuearray()Details
Type
array
Propertyprotectedarray  $_messageVariables= 'array()'

Additional variables available for validation failure messages

Default valuearray()Details
Type
array
Propertyprotectedarray  $_messages= 'array()'

Array of validation failure messages

Default valuearray()Details
Type
array
Propertyprotectedbool  $_obscureValue= 'false'

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

Default valuefalseDetails
Type
bool
Propertyprotected\Zend_Translate  $_translator= ''

Translation object

Details
Type
\Zend_Translate
PropertyprotectedBoolean  $_translatorDisabled= 'false'

Is translation disabled?

Default valuefalseDetails
Type
Boolean
Propertyprotectedmixed  $_value= ''

The value to be validated

Details
Type
mixed

Methods

methodpublic__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.

Parameters
Name Type Description
$property string
Returns
Type Description
mixed
Throws
Exception Description
\Zend_Validate_Exception
methodprotected_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.

Parameters
Name Type Description
$messageKey string
$value string
Returns
Type Description
string
methodprotected_error( string $messageKey, string $value = null ) : void

Parameters
Name Type Description
$messageKey string
$value string

OPTIONAL

methodprotected_setValue( mixed $value ) : void

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

Parameters
Name Type Description
$value mixed
methodpublicgetDefaultTranslator( ) : \Zend_Translate_Adapter|null
static

Get default translation object for all validate objects

Returns
Type Description
\Zend_Translate_Adapter|null
methodpublicgetErrors( ) : array

Returns array of validation failure message codes

Returns
Type Description
array
Details
Deprecated
Since 1.5.0  
methodpublicgetMessageLength( ) : integer
static

Returns the maximum allowed message length

Returns
Type Description
integer
methodpublicgetMessageTemplates( ) : array

Returns the message templates from the validator

Returns
Type Description
array
methodpublicgetMessageVariables( ) : array

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

Returns
Type Description
array
methodpublicgetMessages( ) : array

Returns array of validation failure messages

Returns
Type Description
array
methodpublicgetObscureValue( ) : bool

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

Returns
Type Description
bool
methodpublicgetTranslator( ) : \Zend_Translate_Adapter|null

Return translation object

Returns
Type Description
\Zend_Translate_Adapter|null
methodpublichasDefaultTranslator( ) : boolean
static

Is there a default translation object set?

Returns
Type Description
boolean
methodpublichasTranslator( ) : bool

Does this validator have its own specific translator?

Returns
Type Description
bool
methodpublicsetDefaultTranslator( \Zend_Translate|\Zend_Translate_Adapter|null $translator = null ) : void
static

Set default translation object for all validate objects

Parameters
Name Type Description
$translator \Zend_Translate|\Zend_Translate_Adapter|null
methodpublicsetDisableTranslator( bool $flag ) : \Zend_Validate_Abstract

Indicate whether or not translation should be disabled

Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Validate_Abstract
methodpublicsetMessage( string $messageString, string $messageKey = null ) : \Zend_Validate_Abstract

Sets the validation failure message template for a particular key

Parameters
Name Type Description
$messageString string
$messageKey string

OPTIONAL

Returns
Type Description
\Zend_Validate_Abstract Provides a fluent interface
Throws
Exception Description
\Zend_Validate_Exception
methodpublicsetMessageLength( integer $length = -1 ) : void
static

Sets the maximum allowed message length

Parameters
Name Type Description
$length integer
methodpublicsetMessages( 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.

Parameters
Name Type Description
$messages array
Returns
Type Description
\Zend_Validate_Abstract
methodpublicsetObscureValue( bool $flag ) : \Zend_Validate_Abstract

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

Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Validate_Abstract
methodpublicsetTranslator( \Zend_Translate|\Zend_Translate_Adapter|null $translator = null ) : \Zend_Validate_Abstract

Set translation object

Parameters
Name Type Description
$translator \Zend_Translate|\Zend_Translate_Adapter|null
Returns
Type Description
\Zend_Validate_Abstract
methodpublictranslatorIsDisabled( ) : bool

Is translation disabled?

Returns
Type Description
bool
Documentation was generated by DocBlox 0.15.1.