Filter/Input.php
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 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 = nullThe filter object that is run on values returned by the getEscaped() method.
nullDetails
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)Default values to use when processing filters and validators.
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 $_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.
array()Details- Type
- array

array $_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.
array()Details- Type
- array

array $_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.
array()Details- Type
- array

boolean $_processed = falseSet to False initially, this is set to True after the input data have been processed. Reset to False in setData() method.
falseDetails- Type
- boolean

array $_unknownFields = array()After processing, this contains a copy of $_data elements that were not mentioned in any validation rule.
array()Details- Type
- array

array $_validFields = array()After processing data, this contains mapping of valid fields to field values.
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 |

_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) : mixedCheck 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_InputAdd 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_InputAdd 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_InterfaceRetrieve 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 | nullReturn 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_InputIndicate 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_InputSet 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_InputSet translation object
| Name | Type | Description |
|---|---|---|
| $translator | \Zend_Translate | \Zend_Translate_Adapter | null |
| Type | Description |
|---|---|
| \Zend_Filter_Input |