Validate/Abstract.php

Show: PublicProtectedPrivateinherited
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-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Validate  
Version
$Id$  

\Zend_Validate_Abstract

Package: Zend_Validate
Implements
Children
\Zend_Validate_Isbn
\Zend_Validate_NotEmpty
\Zend_Validate_Ip
\Zend_Validate_InArray
\Zend_Validate_Callback
\Zend_Validate_Between
\Zend_Validate_Sitemap_Priority
\Zend_Validate_Sitemap_Changefreq
\Zend_Validate_Sitemap_Loc
\Zend_Validate_Sitemap_Lastmod
\Zend_Validate_Alpha
\Zend_Validate_Hostname
\Zend_Validate_Date
\Zend_Validate_Alnum
\Zend_Validate_StringLength
\Zend_Validate_Hex
\Zend_Validate_Identical
\Zend_Validate_Barcode
\Zend_Validate_Regex
\Zend_Validate_Iban
\Zend_Validate_LessThan
\Zend_Validate_File_Extension
\Zend_Validate_File_Count
\Zend_Validate_File_Upload
\Zend_Validate_File_MimeType
\Zend_Validate_File_Exists
\Zend_Validate_File_ImageSize
\Zend_Validate_File_Hash
\Zend_Validate_File_Size
\Zend_Validate_CreditCard
\Zend_Validate_GreaterThan
\Zend_Validate_PostCode
\Zend_Validate_Db_Abstract
\Zend_Validate_Ccnum
\Zend_Validate_Int
\Zend_Validate_Ldap_Dn
\Zend_Validate_EmailAddress
\Zend_Validate_Digits
\Zend_Validate_Float
\Zend_Captcha_Base
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotected\Zend_Translate $_defaultTranslator
static
Default translation object for all validate objects
Details
Type
\Zend_Translate
>VPropertyprotectedarray $_errors = array()
Array of validation failure message codes
Default valuearray()Details
Type
array
Deprecated
Since 1.5.0  
>VPropertyprotectedInteger $_messageLength = -1
static
Limits the maximum returned length of a error message
Default value-1Details
Type
Integer
>VPropertyprotectedarray $_messageTemplates = array()
Validation failure message template definitions
Default valuearray()Details
Type
array
>VPropertyprotectedarray $_messageVariables = array()
Additional variables available for validation failure messages
Default valuearray()Details
Type
array
>VPropertyprotectedarray $_messages = array()
Array of validation failure messages
Default valuearray()Details
Type
array
>VPropertyprotectedbool $_obscureValue = false
Flag indidcating whether or not value should be obfuscated in error messages
Default valuefalseDetails
Type
bool
>VPropertyprotected\Zend_Translate $_translator
Translation object
Details
Type
\Zend_Translate
>VPropertyprotectedBoolean $_translatorDisabled = false
Is translation disabled?
Default valuefalseDetails
Type
Boolean
>VPropertyprotectedmixed $_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
NameTypeDescription
$propertystring
Returns
TypeDescription
mixed
Throws
ExceptionDescription
\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
NameTypeDescription
$messageKeystring
$valuestring
Returns
TypeDescription
string
methodprotected_error(string $messageKey, string $value = null) : void

Parameters
NameTypeDescription
$messageKeystring
$valuestring

OPTIONAL

methodprotected_setValue(mixed $value) : void

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

Parameters
NameTypeDescription
$valuemixed
methodpublicgetDefaultTranslator() : \Zend_Translate_Adapter | null
static

Get default translation object for all validate objects

Returns
TypeDescription
\Zend_Translate_Adapter | null
methodpublicgetErrors() : array

Returns array of validation failure message codes

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

Returns the maximum allowed message length

Returns
TypeDescription
integer
methodpublicgetMessageTemplates() : array

Returns the message templates from the validator

Returns
TypeDescription
array
methodpublicgetMessageVariables() : array

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

Returns
TypeDescription
array
methodpublicgetMessages() : array

Returns array of validation failure messages

Returns
TypeDescription
array
methodpublicgetObscureValue() : bool

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

Returns
TypeDescription
bool
methodpublicgetTranslator() : \Zend_Translate_Adapter | null

Return translation object

Returns
TypeDescription
\Zend_Translate_Adapter | null
methodpublichasDefaultTranslator() : boolean
static

Is there a default translation object set?

Returns
TypeDescription
boolean
methodpublichasTranslator() : bool

Does this validator have its own specific translator?

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

Set default translation object for all validate objects

Parameters
NameTypeDescription
$translator\Zend_Translate | \Zend_Translate_Adapter | null
methodpublicsetDisableTranslator(bool $flag) : \Zend_Validate_Abstract

Indicate whether or not translation should be disabled

Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Validate_Abstract
methodpublicsetMessage(string $messageString, string $messageKey = null) : \Zend_Validate_Abstract

Sets the validation failure message template for a particular key

Parameters
NameTypeDescription
$messageStringstring
$messageKeystring

OPTIONAL

Returns
TypeDescription
\Zend_Validate_AbstractProvides a fluent interface
Throws
ExceptionDescription
\Zend_Validate_Exception
methodpublicsetMessageLength(integer $length = -1) : void
static

Sets the maximum allowed message length

Parameters
NameTypeDescription
$lengthinteger
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
NameTypeDescription
$messagesarray
Returns
TypeDescription
\Zend_Validate_Abstract
methodpublicsetObscureValue(bool $flag) : \Zend_Validate_Abstract

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

Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Validate_Abstract
methodpublicsetTranslator(\Zend_Translate | \Zend_Translate_Adapter | null $translator = null) : \Zend_Validate_Abstract

Set translation object

Parameters
NameTypeDescription
$translator\Zend_Translate | \Zend_Translate_Adapter | null
Returns
TypeDescription
\Zend_Validate_Abstract
methodpublictranslatorIsDisabled() : bool

Is translation disabled?

Returns
TypeDescription
bool
Documentation was generated by phpDocumentor 2.2.0 .