<?php
namespace Moto\Application\Users; use Moto\InputFilter\AbstractInputFilter; use Moto; class ChangeUserRoleFilter extends AbstractInputFilter { protected $_name = 'users.change:role'; public function init() { $this->add(array( 'name' => 'user_id', 'required' => true, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'Digits', 'break_chain_on_failure' => true, ), array( 'name' => 'Db_RecordExists', 'options' => array( 'table' => Moto\Config::get('database.prefix') . 'users', 'field' => 'id', 'adapter' => Moto\Config::get('databaseAdapter') ) ) ), )); $this->add(array( 'name' => 'role_id', 'required' => true, )); } }