Filter/Input.php
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 [email protected] 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 24593 2012-01-05 20:35:02Z matthew $
\Zend_Filter_Input
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties


\Zend_Filter_Interface $_defaultEscapeFilter = null
null
Details


array $_defaults = array(self::ALLOW_EMPTY => false, self::BREAK_CHAIN => false, self::ESCAPE_FILTER => 'HtmlEntities', self::MISSING_MESSAGE => "Field '%field%' is required by rule '%rule%', but the field is missing", self::NOT_EMPTY_MESSAGE => "You must give a non-empty value for field '%field%'", self::PRESENCE => self::PRESENCE_OPTIONAL)
array(self::ALLOW_EMPTY => false, self::BREAK_CHAIN => false, self::ESCAPE_FILTER => 'HtmlEntities', self::MISSING_MESSAGE => "Field '%field%' is required by rule '%rule%', but the field is missing", self::NOT_EMPTY_MESSAGE => "You must give a non-empty value for field '%field%'", self::PRESENCE => self::PRESENCE_OPTIONAL)
Details- Type
- array


array $_filterRules = array()
array()
Details- Type
- array


array $_invalidErrors = array()
array()
Details- Type
- array


array $_invalidMessages = array()
array()
Details- Type
- array


array $_missingFields = array()
array()
Details- Type
- array


boolean $_processed = false
false
Details- Type
- boolean


Boolean $_translatorDisabled = false
Is translation disabled?
false
Details- Type
- Boolean


array $_unknownFields = array()
array()
Details- Type
- array


array $_validFields = array()
array()
Details- Type
- array
Methods


__construct(array $filterRules, array $validatorRules, array $data = null, array $options = null) : void
Name | Type | Description |
---|---|---|
$filterRules | array | |
$validatorRules | array | |
$data | array | OPTIONAL |
$options | array | OPTIONAL |


__get(string $fieldName) : mixed
Name | Type | Description |
---|---|---|
$fieldName | string |
Type | Description |
---|---|
mixed |


__isset(string $fieldName) : boolean
Name | Type | Description |
---|---|---|
$fieldName | string |
Type | Description |
---|---|
boolean |


_escapeRecursive( $data) : mixed
Name | Type | Description |
---|---|---|
$data |
Type | Description |
---|---|
mixed |


_getFilter(mixed $classBaseName) : \Zend_Filter_Interface
Name | Type | Description |
---|---|---|
$classBaseName | mixed |
Type | Description |
---|---|
\Zend_Filter_Interface |


_getFilterOrValidator(string $type, mixed $classBaseName) : \Zend_Filter_Interface | \Zend_Validate_Interface
Name | Type | Description |
---|---|---|
$type | string | |
$classBaseName | mixed |
Type | Description |
---|---|
\Zend_Filter_Interface | \Zend_Validate_Interface |
Exception | Description |
---|---|
\Zend_Filter_Exception |


_getMissingMessage(string $rule, string $field) : string
Name | Type | Description |
---|---|---|
$rule | string | |
$field | string |
Type | Description |
---|---|
string |


_getNotEmptyMessage( $rule, $field) : string
Name | Type | Description |
---|---|---|
$rule | ||
$field |
Type | Description |
---|---|
string |


_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.
Name | Type | Description |
---|---|---|
$validatorRule | array |
Type | Description |
---|---|
mixed | false if none is found, Zend_Validate_NotEmpty instance if found |


_getValidator(mixed $classBaseName) : \Zend_Validate_Interface
Name | Type | Description |
---|---|---|
$classBaseName | mixed |
Type | Description |
---|---|
\Zend_Validate_Interface |


addFilterPrefixPath(string $prefix, string $path) : \Zend_Filter_Input
Add prefix path for all elements
Name | Type | Description |
---|---|---|
$prefix | string | |
$path | string |
Type | Description |
---|---|
\Zend_Filter_Input |


addNamespace(mixed $namespaces) : \Zend_Filter_Input
Name | Type | Description |
---|---|---|
$namespaces | mixed |
Type | Description |
---|---|
\Zend_Filter_Input |
- Deprecated
- since 1.5.0RC1 - use addFilterPrefixPath() or addValidatorPrefixPath instead.


addValidatorPrefixPath(string $prefix, string $path) : \Zend_Filter_Input
Add prefix path for all elements
Name | Type | Description |
---|---|---|
$prefix | string | |
$path | string |
Type | Description |
---|---|
\Zend_Filter_Input |


getEscaped(string $fieldName = null) : mixed
Name | Type | Description |
---|---|---|
$fieldName | string | OPTIONAL |
Type | Description |
---|---|
mixed |


getPluginLoader(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.
Name | Type | Description |
---|---|---|
$type | string | 'filter' or 'validate' |
Type | Description |
---|---|
\Zend_Loader_PluginLoader_Interface |
Exception | Description |
---|---|
\Zend_Filter_Exception | on invalid type |


getTranslator() : \Zend_Translate_Adapter | null
Return translation object
Type | Description |
---|---|
\Zend_Translate_Adapter | null |


getUnescaped(string $fieldName = null) : mixed
Name | Type | Description |
---|---|---|
$fieldName | string | OPTIONAL |
Type | Description |
---|---|
mixed |


isValid(string $fieldName = null) : boolean
Name | Type | Description |
---|---|---|
$fieldName | string |
Type | Description |
---|---|
boolean |


process() : \Zend_Filter_Input
Type | Description |
---|---|
\Zend_Filter_Input |
Exception | Description |
---|---|
\Zend_Filter_Exception |


setData(array $data) : \Zend_Filter_Input
Name | Type | Description |
---|---|---|
$data | array |
Type | Description |
---|---|
\Zend_Filter_Input |


setDefaultEscapeFilter(mixed $escapeFilter) : \Zend_Filter_Interface
Name | Type | Description |
---|---|---|
$escapeFilter | mixed |
Type | Description |
---|---|
\Zend_Filter_Interface |


setDisableTranslator(bool $flag) : \Zend_Filter_Input
Indicate whether or not translation should be disabled
Name | Type | Description |
---|---|---|
$flag | bool |
Type | Description |
---|---|
\Zend_Filter_Input |


setOptions(array $options) : \Zend_Filter_Input
Name | Type | Description |
---|---|---|
$options | array |
Type | Description |
---|---|
\Zend_Filter_Input |
Exception | Description |
---|---|
\Zend_Filter_Exception | if an unknown option is given |


setPluginLoader(\Zend_Loader_PluginLoader_Interface $loader, string $type) : \Zend_Filter_Input
Set plugin loaders for use with decorators and elements
Name | Type | Description |
---|---|---|
$loader | \Zend_Loader_PluginLoader_Interface | |
$type | string | 'filter' or 'validate' |
Type | Description |
---|---|
\Zend_Filter_Input |
Exception | Description |
---|---|
\Zend_Filter_Exception | on invalid type |


setTranslator(\Zend_Translate | \Zend_Translate_Adapter | null $translator = null) : \Zend_Filter_Input
Set translation object
Name | Type | Description |
---|---|---|
$translator | \Zend_Translate | \Zend_Translate_Adapter | null |
Type | Description |
---|---|
\Zend_Filter_Input |