Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
CollectionInputFilter Class Reference

Public Member Functions

 setInputFilter ($inputFilter)
 Set the input filter to use when looping the data.
 
 getInputFilter ()
 Get the input filter used when looping the data.
 
 setIsRequired ($isRequired)
 Set if the collection can be empty.
 
 getIsRequired ()
 Get if collection can be empty.
 
 setCount ($count)
 Set the count of data to validate.
 
 getCount ()
 Get the count of data to validate, use the count of data by default.
 
 setData ($data)
 {Set data to use when validating and filtering.
Parameters
array | Traversable$data
Returns
InputFilterInterface
}
 
 isValid ()
 {Is the data set valid?
Returns
bool
}
 
 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
}
 
 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
}
 
 getRawValues ()
 {Return a list of unfiltered values.List should be an associative array of named input/value pairs, with the values unfiltered.
Returns
array
}
 
 clearValues ()
 Clear collectionValues.
 
 clearRawValues ()
 Clear collectionRawValues.
 
 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[]
}
 
- Public Member Functions inherited from InputFilter
 setFactory (Factory $factory)
 Set factory to use when adding inputs and filters by spec.
 
 getFactory ()
 Get factory to use when adding inputs and filters by spec.
 
 add ($input, $name=null)
 Add an input to the input filter.
 
- Public Member Functions inherited from BaseInputFilter
 init ()
 This function is automatically called when creating element with factory.
 
 count ()
 Countable: number of inputs in this input filter.
 
 add ($input, $name=null)
 Add an input to the input filter.
 
 replace ($input, $name)
 Replace a named input.
 
 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 ($context=null)
 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.
 
 hasUnknown ()
 Is the data set has unknown input ?
 
 getUnknown ()
 Return the unknown input.
 
 getInputs ()
 Get an array of all inputs.
 
 merge (BaseInputFilter $inputFilter)
 Merges the inputs from an InputFilter into the current one.
 

Protected Attributes

 $isRequired = false
 
 $count = null
 
 $collectionValues = []
 
 $collectionRawValues = []
 
 $collectionMessages = []
 
 $inputFilter
 
- Protected Attributes inherited from InputFilter
 $factory
 
- Protected Attributes inherited from BaseInputFilter
 $data
 
 $inputs = []
 
 $invalidInputs
 
 $validationGroup
 
 $validInputs
 

Additional Inherited Members

- Public Attributes inherited from InputFilterInterface
const VALIDATE_ALL = 'INPUT_FILTER_ALL'
 
- Protected Member Functions inherited from BaseInputFilter
 validateInputs (array $inputs, $data=[], $context=null)
 Validate a set of inputs against the current data.
 
 validateValidationGroup (array $inputs)
 Ensure all names of a validation group exist as input in the filter.
 
 populate ()
 Populate the values of all attached inputs.
 

Member Function Documentation

clearRawValues ( )

Clear collectionRawValues.

Returns
array[]
clearValues ( )

Clear collectionValues.

Returns
array[]
getCount ( )

Get the count of data to validate, use the count of data by default.

Returns
int
getInputFilter ( )

Get the input filter used when looping the data.

Returns
BaseInputFilter
getIsRequired ( )

Get if collection can be empty.

Returns
bool
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[]
}

Implements InputFilterInterface.

getRawValues ( )

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

Returns
array
}

Implements InputFilterInterface.

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
}

Implements InputFilterInterface.

isValid ( )

{Is the data set valid?

Returns
bool
}

Implements InputFilterInterface.

setCount (   $count)

Set the count of data to validate.

Parameters
int$count
Returns
CollectionInputFilter
setData (   $data)

{Set data to use when validating and filtering.

Parameters
array | Traversable$data
Returns
InputFilterInterface
}

Implements InputFilterInterface.

setInputFilter (   $inputFilter)

Set the input filter to use when looping the data.

Parameters
BaseInputFilter | array | Traversable$inputFilter
Exceptions
Exception\RuntimeException
Returns
CollectionInputFilter
setIsRequired (   $isRequired)

Set if the collection can be empty.

Parameters
bool$isRequired
Returns
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
}

Implements InputFilterInterface.

Member Data Documentation

$collectionMessages = []
protected
$collectionRawValues = []
protected
$collectionValues = []
protected
$count = null
protected
$inputFilter
protected
$isRequired = false
protected