Zend Framework  3.0
Public Member Functions | Public Attributes | List of all members
InputFilterInterface Interface Reference

Public Member Functions

 add ($input, $name=null)
 Add an input to the input filter.
 
 get ($name)
 Retrieve a named input.
 
 has ($name)
 Test if an input or input filter by the given name is attached.
 
 remove ($name)
 Remove a named input.
 
 setData ($data)
 Set data to use when validating and filtering.
 
 isValid ()
 Is the data set valid?
 
 setValidationGroup ($name)
 Provide a list of one or more elements indicating the complete set to validate.
 
 getInvalidInput ()
 Return a list of inputs that were invalid.
 
 getValidInput ()
 Return a list of inputs that were valid.
 
 getValue ($name)
 Retrieve a value from a named input.
 
 getValues ()
 Return a list of filtered values.
 
 getRawValue ($name)
 Retrieve a raw (unfiltered) value from a named input.
 
 getRawValues ()
 Return a list of unfiltered values.
 
 getMessages ()
 Return a list of validation failure messages.
 

Public Attributes

const VALIDATE_ALL = 'INPUT_FILTER_ALL'
 

Member Function Documentation

add (   $input,
  $name = null 
)

Add an input to the input filter.

Parameters
InputInterface | InputFilterInterface | array | Traversable$inputImplementations MUST handle at least one of the specified types, and raise an exception for any they cannot process.
null | string$nameName used to retrieve this input
Returns
InputFilterInterface
Exceptions
Exception\InvalidArgumentExceptionif unable to handle the input type.

Implemented in BaseInputFilter, and InputFilter.

get (   $name)

Retrieve a named input.

Parameters
string$name
Returns
InputInterface|InputFilterInterface

Implemented in BaseInputFilter.

getInvalidInput ( )

Return a list of inputs that were invalid.

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

Returns
InputInterface[]

Implemented in BaseInputFilter.

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
string[]

Implemented in BaseInputFilter, and CollectionInputFilter.

getRawValue (   $name)

Retrieve a raw (unfiltered) value from a named input.

Parameters
string$name
Returns
mixed

Implemented in BaseInputFilter.

getRawValues ( )

Return a list of unfiltered values.

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

Returns
array

Implemented in BaseInputFilter, and CollectionInputFilter.

getValidInput ( )

Return a list of inputs that were valid.

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

Returns
InputInterface[]

Implemented in BaseInputFilter.

getValue (   $name)

Retrieve a value from a named input.

Parameters
string$name
Returns
mixed

Implemented in BaseInputFilter.

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

Implemented in BaseInputFilter, and CollectionInputFilter.

has (   $name)

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

Parameters
string$name
Returns
bool

Implemented in BaseInputFilter.

isValid ( )

Is the data set valid?

Returns
bool

Implemented in CollectionInputFilter.

remove (   $name)

Remove a named input.

Parameters
string$name
Returns
InputFilterInterface

Implemented in BaseInputFilter.

setData (   $data)

Set data to use when validating and filtering.

Parameters
array | Traversable$data
Returns
InputFilterInterface

Implemented in BaseInputFilter, and CollectionInputFilter.

setValidationGroup (   $name)

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

When provided, calls to isValid() will only validate the provided set.

If the initial value is 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.

Parameters
mixed$name
Returns
InputFilterInterface

Implemented in BaseInputFilter, and CollectionInputFilter.

Member Data Documentation

const VALIDATE_ALL = 'INPUT_FILTER_ALL'