Class InputFilter

Summary

Fully Qualified Name: Zend\InputFilter\InputFilter
Extends: BaseInputFilter

Description

Methods

Name Description Defined By
add() Add an input to the input filter InputFilter
count() Countable: number of inputs in this input filter BaseInputFilter
get() Retrieve a named input BaseInputFilter
getFactory() Get factory to use when adding inputs and filters by spec InputFilter
getInputs() Get an array of all inputs BaseInputFilter
getInvalidInput() Return a list of inputs that were invalid. BaseInputFilter
getMessages() Return a list of validation failure messages BaseInputFilter
getRawValue() Retrieve a raw (unfiltered) value from a named input BaseInputFilter
getRawValues() Return a list of unfiltered values BaseInputFilter
getUnfilteredData() BaseInputFilter
getUnknown() Return the unknown input BaseInputFilter
getValidInput() Return a list of inputs that were valid. BaseInputFilter
getValue() Retrieve a value from a named input BaseInputFilter
getValues() Return a list of filtered values BaseInputFilter
has() Test if an input or input filter by the given name is attached BaseInputFilter
hasUnknown() Is the data set has unknown input ? BaseInputFilter
init() This function is automatically called when creating element with factory. It allows to perform various operations (add elements. BaseInputFilter
isValid() Is the data set valid? BaseInputFilter
merge() Merges the inputs from an InputFilter into the current one BaseInputFilter
remove() Remove a named input BaseInputFilter
replace() Replace a named input BaseInputFilter
setData() Set data to use when validating and filtering BaseInputFilter
setFactory() Set factory to use when adding inputs and filters by spec InputFilter
setUnfilteredData() BaseInputFilter
setValidationGroup() Provide a list of one or more elements indicating the complete set to validate BaseInputFilter

Method Details

add()

Add an input to the input filter

Parameter Name Type Description
$input array|\Traversable|\InputInterface|\InputFilterInterface
$name null|string

Returns: \InputFilter

count()

Countable: number of inputs in this input filter

Only details the number of direct children.

Returns: int

get()

Retrieve a named input

Parameter Name Type Description
$name string

Returns: \InputInterface|\InputFilterInterface

getFactory()

Get factory to use when adding inputs and filters by spec

Lazy-loads a Factory instance if none attached.

Returns: \Factory

getInputs()

Get an array of all inputs

Returns: \InputInterface[]|\InputFilterInterface[]

getInvalidInput()

Return a list of inputs that were invalid.

Implementations should return an associative array of name/input pairs that failed validation.

Returns: \InputInterface[]

getMessages()

Return a list of validation failure messages

Should return an associative array of named input/message list pairs. Pairs should only be returned for inputs that failed validation.

Returns: array

getRawValue()

Retrieve a raw (unfiltered) value from a named input

Parameter Name Type Description
$name string

Returns: mixed

getRawValues()

Return a list of unfiltered values

List should be an associative array of named input/value pairs, with the values unfiltered.

Returns: array

getUnfilteredData()

Returns: array|object

getUnknown()

Return the unknown input

Returns: array

getValidInput()

Return a list of inputs that were valid.

Implementations should return an associative array of name/input pairs that passed validation.

Returns: \InputInterface[]

getValue()

Retrieve a value from a named input

Parameter Name Type Description
$name string

Returns: mixed

getValues()

Return a list of filtered values

List should be an associative array, with the values filtered. If validation failed, this should raise an exception.

Returns: array

has()

Test if an input or input filter by the given name is attached

Parameter Name Type Description
$name string

Returns: bool

hasUnknown()

Is the data set has unknown input ?

Returns: bool

init()

This function is automatically called when creating element with factory. It allows to perform various operations (add elements.

..)

Returns: void

isValid()

Is the data set valid?

Parameter Name Type Description
$context mixed|null

Returns: bool

merge()

Merges the inputs from an InputFilter into the current one

Parameter Name Type Description
$inputFilter \BaseInputFilter

Returns: self

remove()

Remove a named input

Parameter Name Type Description
$name string

Returns: \InputFilterInterface

replace()

Replace a named input

Parameter Name Type Description
$input mixed Any
$name string Name

Returns: self

setData()

Set data to use when validating and filtering

Parameter Name Type Description
$data null|array|\Traversable null

Returns: \InputFilterInterface

setFactory()

Set factory to use when adding inputs and filters by spec

Parameter Name Type Description
$factory \Factory

Returns: \InputFilter

setUnfilteredData()

Parameter Name Type Description
$data array|object

Returns: $this

setValidationGroup()

Provide a list of one or more elements indicating the complete set to validate

When provided, calls to {@link isValid()} will only validate the provided set.

If the initial value is {@link VALIDATE_ALL}, the current validation group, if any, should be cleared.

Implementations should allow passing a single array value, or multiple arguments, each specifying a single input.

Parameter Name Type Description
$name mixed

Returns: \InputFilterInterface

Top