- if (!$this->inputFilter) {
- $inputFilter = new InputFilter;
- $factory = new InputFactory;
-
- $inputFilter->add($factory->createInput(array(
- 'name' => 'id',
- 'required' => true,
- 'filters' => array(
- array('name' => 'Int'),
- ),
- )));
-
- $inputFilter->add($factory->createInput(array(
- 'name' => 'name',
- 'required' => true,
- 'filters' => array(
- array('name' => 'StripTags'),
- array('name' => 'StringTrim'),
- ),
- 'validators' => array(
- array(
- 'name' => 'StringLength',
- 'options' => array(
- 'encoding' => 'UTF-8',
- 'min' => 1,
- 'max' => 32,
- ),
- ),
- ),
- )));
-
- $inputFilter->add($factory->createInput(array(
- 'name' => 'description',
- 'required' => true,
- 'filters' => array(
- array('name' => 'StripTags'),
- array('name' => 'StringTrim'),
- ),
- )));
-
- $this->inputFilter = $inputFilter;
- }
-
- return $this->inputFilter;
-