<?php
namespace Moto\Application\MediaLibrary\InputFilter; use Moto\InputFilter\AbstractInputFilter; use Moto; class Upload extends AbstractInputFilter { protected $_name = 'mediaLibrary.upload'; public function init() { $this->add(array( 'name' => 'folder_id', 'required' => true, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), array('name' => 'Moto\Filter\IntValue'), ), 'validators' => array( array( 'name' => 'Digits', 'break_chain_on_failure' => true, ), array( 'name' => 'Moto\Validator\ParentId', 'options' => array( 'table' => Moto\Config::get('database.prefix') . 'media_folders', 'field' => 'id', 'adapter' => Moto\Config::get('databaseAdapter'), ) ) ), )); $this->add(array( 'name' => 'is_protected', 'required' => false, 'filters' => array( array('name' => 'Moto\Filter\IntValue'), array( 'name' => 'Moto\Filter\DefaultFilter', 'options' => array( 'value' => 0 ) ), ), 'validators' => array( array( 'name' => 'InArray', 'options' => array( 'haystack' => array(false, true, 0, 1) ) ), ), )); } }