API Documentation

Zend/Filter/Input.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_Filter  
Version
$Id: Input.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Filter_Input

Package: Zend\Filter

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constant  ALLOW_EMPTY = 'allowEmpty'
Constant  BREAK_CHAIN = 'breakChainOnFailure'
Constant  DEFAULT_VALUE = 'default'
Constant  MESSAGES = 'messages'
Constant  ESCAPE_FILTER = 'escapeFilter'
Constant  FIELDS = 'fields'
Constant  FILTER = 'filter'
Constant  FILTER_CHAIN = 'filterChain'
Constant  MISSING_MESSAGE = 'missingMessage'
Constant  INPUT_NAMESPACE = 'inputNamespace'
Constant  VALIDATOR_NAMESPACE = 'validatorNamespace'
Constant  FILTER_NAMESPACE = 'filterNamespace'
Constant  NOT_EMPTY_MESSAGE = 'notEmptyMessage'
Constant  PRESENCE = 'presence'
Constant  PRESENCE_OPTIONAL = 'optional'
Constant  PRESENCE_REQUIRED = 'required'
Constant  RULE = 'rule'
Constant  RULE_WILDCARD = '*'
Constant  VALIDATE = 'validate'
Constant  VALIDATOR = 'validator'
Constant  VALIDATOR_CHAIN = 'validatorChain'
Constant  VALIDATOR_CHAIN_COUNT = 'validatorChainCount'

Properties

Propertyprotectedarray  $_data= 'array()'

Input data, before processing.
Default valuearray()Details
Type
array
Propertyprotected\Zend_Filter_Interface  $_defaultEscapeFilter= 'null'

The filter object that is run on values returned by the getEscaped() method.
Default valuenullDetails
Type
\Zend_Filter_Interface
Propertyprotectedarray  $_defaults= 'array( self::ALLOW_EMPTY => false'

Default values to use when processing filters and validators.
Default valuearray( self::ALLOW_EMPTY => falseDetails
Type
array
Propertyprotectedarray  $_filterRules= 'array()'

Association of rules to filters.
Default valuearray()Details
Type
array
Propertyprotectedarray  $_invalidErrors= 'array()'

After processing data, this contains mapping of validation rules that did not pass validation to the array of error identifiers returned by the validator chain.
Default valuearray()Details
Type
array
Propertyprotectedarray  $_invalidMessages= 'array()'

After processing data, this contains mapping of validation rules that did not pass validation to the array of messages returned by the validator chain.
Default valuearray()Details
Type
array
Propertyprotectedarray  $_loaders= 'array()'

Plugin loaders

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

After processing data, this contains mapping of validation rules in which some fields were missing to the array of messages indicating which fields were missing.
Default valuearray()Details
Type
array
Propertyprotectedboolean  $_processed= 'false'

Set to False initially, this is set to True after the input data have been processed. Reset to False in setData() method.
Default valuefalseDetails
Type
boolean
Propertyprotected\Zend_Translate  $_translator= ''

Translation object

Details
Type
\Zend_Translate
PropertyprotectedBoolean  $_translatorDisabled= 'false'

Is translation disabled?

Default valuefalseDetails
Type
Boolean
Propertyprotectedarray  $_unknownFields= 'array()'

After processing, this contains a copy of $_data elements that were not mentioned in any validation rule.
Default valuearray()Details
Type
array
Propertyprotectedarray  $_validFields= 'array()'

After processing data, this contains mapping of valid fields to field values.
Default valuearray()Details
Type
array
Propertyprotectedarray  $_validatorRules= 'array()'

Association of rules to validators.
Default valuearray()Details
Type
array

Methods

methodpublic__construct( array $filterRules, array $validatorRules, array $data = null, array $options = null ) : void

Parameters
Name Type Description
$filterRules array
$validatorRules array
$data array

OPTIONAL

$options array

OPTIONAL

methodpublic__get( string $fieldName ) : mixed

Parameters
Name Type Description
$fieldName string
Returns
Type Description
mixed
methodpublic__isset( string $fieldName ) : boolean

Parameters
Name Type Description
$fieldName string
Returns
Type Description
boolean
methodprotected_escapeRecursive(  $data ) : mixed

Parameters
Name Type Description
$data
Returns
Type Description
mixed
methodprotected_filter( ) : void

methodprotected_filterRule( array $filterRule ) : void

Parameters
Name Type Description
$filterRule array
methodprotected_getDefaultEscapeFilter( ) : \Zend_Filter_Interface

Returns
Type Description
\Zend_Filter_Interface
methodprotected_getFilter( mixed $classBaseName ) : \Zend_Filter_Interface

Parameters
Name Type Description
$classBaseName mixed
Returns
Type Description
\Zend_Filter_Interface
methodprotected_getFilterOrValidator( string $type, mixed $classBaseName ) : \Zend_Filter_Interface|\Zend_Validate_Interface

Parameters
Name Type Description
$type string
$classBaseName mixed
Returns
Type Description
\Zend_Filter_Interface|\Zend_Validate_Interface
Throws
Exception Description
\Zend_Filter_Exception
methodprotected_getMissingMessage( string $rule, string $field ) : string

Parameters
Name Type Description
$rule string
$field string
Returns
Type Description
string
methodprotected_getNotEmptyMessage(  $rule,  $field ) : string

Parameters
Name Type Description
$rule
$field
Returns
Type Description
string
methodprotected_getNotEmptyValidatorInstance( array $validatorRule ) : mixed

Check a validatorRule for the presence of a NotEmpty validator instance.

The purpose is to preserve things like a custom message, that may have been set on the validator outside Zend_Filter_Input.

Parameters
Name Type Description
$validatorRule array
Returns
Type Description
mixed false if none is found, Zend_Validate_NotEmpty instance if found
methodprotected_getValidator( mixed $classBaseName ) : \Zend_Validate_Interface

Parameters
Name Type Description
$classBaseName mixed
Returns
Type Description
\Zend_Validate_Interface
methodprotected_process( ) : void

methodprotected_validate( ) : void

methodprotected_validateRule( array $validatorRule ) : void

Parameters
Name Type Description
$validatorRule array
methodpublicaddFilterPrefixPath( string $prefix, string $path ) : \Zend_Filter_Input

Add prefix path for all elements

Parameters
Name Type Description
$prefix string
$path string
Returns
Type Description
\Zend_Filter_Input
methodpublicaddNamespace( mixed $namespaces ) : \Zend_Filter_Input

Parameters
Name Type Description
$namespaces mixed
Returns
Type Description
\Zend_Filter_Input
Details
Deprecated
since 1.5.0RC1 - use addFilterPrefixPath() or addValidatorPrefixPath instead.  
methodpublicaddValidatorPrefixPath( string $prefix, string $path ) : \Zend_Filter_Input

Add prefix path for all elements

Parameters
Name Type Description
$prefix string
$path string
Returns
Type Description
\Zend_Filter_Input
methodpublicgetErrors( ) : array

Returns
Type Description
array
methodpublicgetEscaped( string $fieldName = null ) : mixed

Parameters
Name Type Description
$fieldName string

OPTIONAL

Returns
Type Description
mixed
methodpublicgetInvalid( ) : array

Returns
Type Description
array
methodpublicgetMessages( ) : array

Returns
Type Description
array
methodpublicgetMissing( ) : array

Returns
Type Description
array
methodpublicgetPluginLoader( string $type ) : \Zend_Loader_PluginLoader_Interface

Retrieve plugin loader for given type

$type may be one of: - filter - validator

If a plugin loader does not exist for the given type, defaults are created.

Parameters
Name Type Description
$type string

'filter' or 'validate'

Returns
Type Description
\Zend_Loader_PluginLoader_Interface
Throws
Exception Description
\Zend_Filter_Exception on invalid type
methodpublicgetTranslator( ) : \Zend_Translate_Adapter|null

Return translation object

Returns
Type Description
\Zend_Translate_Adapter|null
methodpublicgetUnescaped( string $fieldName = null ) : mixed

Parameters
Name Type Description
$fieldName string

OPTIONAL

Returns
Type Description
mixed
methodpublicgetUnknown( ) : array

Returns
Type Description
array
methodpublichasInvalid( ) : boolean

Returns
Type Description
boolean
methodpublichasMissing( ) : boolean

Returns
Type Description
boolean
methodpublichasUnknown( ) : boolean

Returns
Type Description
boolean
methodpublichasValid( ) : boolean

Returns
Type Description
boolean
methodpublicisValid( string $fieldName = null ) : boolean

Parameters
Name Type Description
$fieldName string
Returns
Type Description
boolean
methodpublicprocess( ) : \Zend_Filter_Input

Returns
Type Description
\Zend_Filter_Input
Throws
Exception Description
\Zend_Filter_Exception
methodpublicsetData( array $data ) : \Zend_Filter_Input

Parameters
Name Type Description
$data array
Returns
Type Description
\Zend_Filter_Input
methodpublicsetDefaultEscapeFilter( mixed $escapeFilter ) : \Zend_Filter_Interface

Parameters
Name Type Description
$escapeFilter mixed
Returns
Type Description
\Zend_Filter_Interface
methodpublicsetDisableTranslator( bool $flag ) : \Zend_Filter_Input

Indicate whether or not translation should be disabled

Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Filter_Input
methodpublicsetOptions( array $options ) : \Zend_Filter_Input

Parameters
Name Type Description
$options array
Returns
Type Description
\Zend_Filter_Input
Throws
Exception Description
\Zend_Filter_Exception if an unknown option is given
methodpublicsetPluginLoader( \Zend_Loader_PluginLoader_Interface $loader, string $type ) : \Zend_Filter_Input

Set plugin loaders for use with decorators and elements

Parameters
Name Type Description
$loader \Zend_Loader_PluginLoader_Interface
$type string

'filter' or 'validate'

Returns
Type Description
\Zend_Filter_Input
Throws
Exception Description
\Zend_Filter_Exception on invalid type
methodpublicsetTranslator( \Zend_Translate|\Zend_Translate_Adapter|null $translator = null ) : \Zend_Filter_Input

Set translation object

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

Is translation disabled?

Returns
Type Description
bool
Documentation was generated by DocBlox 0.15.1.