<?php
namespace Moto\Application\Pages\InputFilter; use Moto\InputFilter\AbstractInputFilter; use Zend\InputFilter\Exception; use Moto; class ReassignAuthor extends AbstractInputFilter { protected $_name = 'pages.change:author'; public function init() { $this->add(array( 'name' => 'author_id', 'required' => true, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( "name" => "Digits", 'break_chain_on_failure' => true, ) ), )); $this->add(array( 'name' => 'new_author_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') ) ) ), )); } }