Source of file InputFilterInterface.php
Size: 3,726 Bytes - Last Modified: 2014-03-12T23:21:18+01:00
/home/theseer/Downloads/ZendFramework-2.3.0/library/Zend/InputFilter/InputFilterInterface.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 | <?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\InputFilter; use Countable; use Traversable; interface InputFilterInterface extends Countable { const VALIDATE_ALL = 'INPUT_FILTER_ALL'; /** * Add an input to the input filter * * @param InputInterface|InputFilterInterface|array $input * @param null|string $name Name used to retrieve this input * @return InputFilterInterface */ public function add($input, $name = null); /** * Retrieve a named input * * @param string $name * @return InputInterface|InputFilterInterface */ public function get($name); /** * Test if an input or input filter by the given name is attached * * @param string $name * @return bool */ public function has($name); /** * Remove a named input * * @param string $name * @return InputFilterInterface */ public function remove($name); /** * Set data to use when validating and filtering * * @param array|Traversable $data * @return InputFilterInterface */ public function setData($data); /** * Is the data set valid? * * @return bool */ public function isValid(); /** * 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. * * @param mixed $name * @return InputFilterInterface */ public function setValidationGroup($name); /** * Return a list of inputs that were invalid. * * Implementations should return an associative array of name/input pairs * that failed validation. * * @return InputInterface[] */ public function getInvalidInput(); /** * Return a list of inputs that were valid. * * Implementations should return an associative array of name/input pairs * that passed validation. * * @return InputInterface[] */ public function getValidInput(); /** * Retrieve a value from a named input * * @param string $name * @return mixed */ public function getValue($name); /** * Return a list of filtered values * * List should be an associative array, with the values filtered. If * validation failed, this should raise an exception. * * @return array */ public function getValues(); /** * Retrieve a raw (unfiltered) value from a named input * * @param string $name * @return mixed */ public function getRawValue($name); /** * Return a list of unfiltered values * * List should be an associative array of named input/value pairs, * with the values unfiltered. * * @return array */ public function getRawValues(); /** * 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. * * @return array */ public function getMessages(); } |