category Zend
package Zend_Filter
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

__construct()

__construct(array $filterRules, array $validatorRules, array $data = null, array $options = null

Parameters

$filterRules

array

$validatorRules

array

$data

array

OPTIONAL

$options

array

OPTIONAL

__get()

__get(string $fieldName) : mixed

Parameters

$fieldName

string

Returns

mixed

__isset()

__isset(string $fieldName) : boolean

Parameters

$fieldName

string

Returns

boolean

Add prefix path for all elements

addFilterPrefixPath(string $prefix, string $path) : \Zend_Filter_Input

Parameters

$prefix

string

$path

string

Returns

\Zend_Filter_Input

addNamespace()

addNamespace(mixed $namespaces) : \Zend_Filter_Input
deprecated since 1.5.0RC1 - use addFilterPrefixPath() or addValidatorPrefixPath instead.

Parameters

$namespaces

mixed

Returns

\Zend_Filter_Input

Add prefix path for all elements

addValidatorPrefixPath(string $prefix, string $path) : \Zend_Filter_Input

Parameters

$prefix

string

$path

string

Returns

\Zend_Filter_Input

getErrors()

getErrors() : array

Returns

array

getEscaped()

getEscaped(string $fieldName = null) : mixed

Parameters

$fieldName

string

OPTIONAL

Returns

mixed

getInvalid()

getInvalid() : array

Returns

array

getMessages()

getMessages() : array

Returns

array

getMissing()

getMissing() : array

Returns

array

Retrieve plugin loader for given type

getPluginLoader(string $type) : \Zend_Loader_PluginLoader_Interface

$type may be one of:

  • filter
  • validator

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

Parameters

$type

string

'filter' or 'validate'

Exceptions

\Zend_Filter_Exception on invalid type

Returns

\Zend_Loader_PluginLoader_Interface

Return translation object

getTranslator() : \Zend_Translate_Adapter | null

Returns

\Zend_Translate_Adapternull

getUnescaped()

getUnescaped(string $fieldName = null) : mixed

Parameters

$fieldName

string

OPTIONAL

Returns

mixed

getUnknown()

getUnknown() : array

Returns

array

hasInvalid()

hasInvalid() : boolean

Returns

boolean

hasMissing()

hasMissing() : boolean

Returns

boolean

hasUnknown()

hasUnknown() : boolean

Returns

boolean

hasValid()

hasValid() : boolean

Returns

boolean

isValid()

isValid(string $fieldName = null) : boolean

Parameters

$fieldName

string

Returns

boolean

process()

process() : \Zend_Filter_Input

Exceptions

\Zend_Filter_Exception

Returns

\Zend_Filter_Input

setData()

setData(array $data) : \Zend_Filter_Input

Parameters

$data

array

Returns

\Zend_Filter_Input

setDefaultEscapeFilter()

setDefaultEscapeFilter(mixed $escapeFilter) : \Zend_Filter_Interface

Parameters

$escapeFilter

mixed

Returns

\Zend_Filter_Interface

Indicate whether or not translation should be disabled

setDisableTranslator(boolean $flag) : \Zend_Filter_Input

Parameters

$flag

boolean

Returns

\Zend_Filter_Input

setOptions()

setOptions(array $options) : \Zend_Filter_Input

Parameters

$options

array

Exceptions

\Zend_Filter_Exception if an unknown option is given

Returns

\Zend_Filter_Input

Set plugin loaders for use with decorators and elements

setPluginLoader(\Zend_Loader_PluginLoader_Interface $loader, string $type) : \Zend_Filter_Input

Parameters

$loader

\Zend_Loader_PluginLoader_Interface

$type

string

'filter' or 'validate'

Exceptions

\Zend_Filter_Exception on invalid type

Returns

\Zend_Filter_Input

Set translation object

setTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null) : \Zend_Filter_Input

Parameters

$translator

\Zend_Translate\Zend_Translate_Adapternull

Returns

\Zend_Filter_Input

Is translation disabled?

translatorIsDisabled() : boolean

Returns

boolean

_escapeRecursive()

_escapeRecursive($data) : mixed

Parameters

$data

Returns

mixed

_filter()

_filter() : void

_filterRule()

_filterRule(array $filterRule) : void

Parameters

$filterRule

array

_getDefaultEscapeFilter()

_getDefaultEscapeFilter() : \Zend_Filter_Interface

Returns

\Zend_Filter_Interface

_getFilter()

_getFilter(mixed $classBaseName) : \Zend_Filter_Interface

Parameters

$classBaseName

mixed

Returns

\Zend_Filter_Interface

_getFilterOrValidator()

_getFilterOrValidator(string $type, mixed $classBaseName) : \Zend_Filter_Interface | \Zend_Validate_Interface

Parameters

$type

string

$classBaseName

mixed

Exceptions

\Zend_Filter_Exception

Returns

\Zend_Filter_Interface\Zend_Validate_Interface

_getMissingMessage()

_getMissingMessage(string $rule, string $field) : string

Parameters

$rule

string

$field

string

Returns

string

_getNotEmptyMessage()

_getNotEmptyMessage($rule, $field) : string

Parameters

$rule

$field

Returns

string

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

_getNotEmptyValidatorInstance(array $validatorRule) : mixed

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

Parameters

$validatorRule

array

Returns

mixedfalse if none is found, Zend_Validate_NotEmpty instance if found

_getValidator()

_getValidator(mixed $classBaseName) : \Zend_Validate_Interface

Parameters

$classBaseName

mixed

Returns

\Zend_Validate_Interface

_process()

_process() : void

_validate()

_validate() : void

_validateRule()

_validateRule(array $validatorRule) : void

Parameters

$validatorRule

array

 Properties

 

Input data, before processing.

$_data : array

Default

array()
 

The filter object that is run on values returned by the getEscaped() method.

$_defaultEscapeFilter : \Zend_Filter_Interface

Default

null
 

Default values to use when processing filters and validators.

$_defaults : array

Default

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)
 

Association of rules to filters.

$_filterRules : array

Default

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.

$_invalidErrors : array

Default

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.

$_invalidMessages : array

Default

array()
 

Plugin loaders

$_loaders : array

Default

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.

$_missingFields : array

Default

array()
 

Set to False initially, this is set to True after the input data have been processed. Reset to False in setData() method.

$_processed : boolean

Default

false
 

Translation object

$_translator : \Zend_Translate

Default

 

Is translation disabled?

$_translatorDisabled : Boolean

Default

false
 

After processing, this contains a copy of $_data elements that were not mentioned in any validation rule.

$_unknownFields : array

Default

array()
 

After processing data, this contains mapping of valid fields to field values.

$_validFields : array

Default

array()
 

Association of rules to validators.

$_validatorRules : array

Default

array()

 Constants

 

ALLOW_EMPTY

ALLOW_EMPTY = 'allowEmpty' 
 

BREAK_CHAIN

BREAK_CHAIN = 'breakChainOnFailure' 
 

DEFAULT_VALUE

DEFAULT_VALUE = 'default' 
 

ESCAPE_FILTER

ESCAPE_FILTER = 'escapeFilter' 
 

FIELDS

FIELDS = 'fields' 
 

FILTER

FILTER = 'filter' 
 

FILTER_CHAIN

FILTER_CHAIN = 'filterChain' 
 

FILTER_NAMESPACE

FILTER_NAMESPACE = 'filterNamespace' 
 

INPUT_NAMESPACE

INPUT_NAMESPACE = 'inputNamespace' 
 

MESSAGES

MESSAGES = 'messages' 
 

MISSING_MESSAGE

MISSING_MESSAGE = 'missingMessage' 
 

NOT_EMPTY_MESSAGE

NOT_EMPTY_MESSAGE = 'notEmptyMessage' 
 

PRESENCE

PRESENCE = 'presence' 
 

PRESENCE_OPTIONAL

PRESENCE_OPTIONAL = 'optional' 
 

PRESENCE_REQUIRED

PRESENCE_REQUIRED = 'required' 
 

RULE

RULE = 'rule' 
 

RULE_WILDCARD

RULE_WILDCARD = '*' 
 

VALIDATE

VALIDATE = 'validate' 
 

VALIDATOR

VALIDATOR = 'validator' 
 

VALIDATOR_CHAIN

VALIDATOR_CHAIN = 'validatorChain' 
 

VALIDATOR_CHAIN_COUNT

VALIDATOR_CHAIN_COUNT = 'validatorChainCount' 
 

VALIDATOR_NAMESPACE

VALIDATOR_NAMESPACE = 'validatorNamespace'