<?php
namespace Moto\Application\Fonts\InputFilter; use Moto; use Zend; class DestroyFontVariant extends Moto\InputFilter\AbstractInputFilter { protected $_name = 'fonts.destroyFontVariant'; public function init() { $this->add([ 'name' => 'id', 'required' => true, 'validators' => [ [ 'name' => 'Digits', 'break_chain_on_failure' => true, ], [ 'name' => Moto\Validator\Db\RecordExists::class, 'options' => [ 'table' => Moto\Config::get('database.prefix') . 'fonts', 'field' => 'id', 'adapter' => Moto\System::getDatabaseAdapter(), ], ], ], ]); $this->add([ 'name' => 'variant', 'required' => true, 'filters' => [ ['name' => 'StripTags'], ['name' => 'StringTrim'], ], 'validators' => [ [ 'name' => Zend\Validator\InArray::class, 'options' => [ 'haystack' => [ '100', '100italic', '200', '200italic', '300', '300italic', '400', '400italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic', ], ], ], ], ]); } } 