<?php
namespace Moto\Application\Pages\InputFilter; use Moto\InputFilter\AbstractInputFilter; use Zend\InputFilter\Exception; class PagePropertiesMeta extends AbstractInputFilter { protected $_name = 'pages.change:properties.meta'; public function init() { $this->add(array( 'name' => 'keywords', 'required' => false, 'filters' => array( array('name' => 'Moto\Filter\NullValue'), array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'max' => 512, ), ), ), )); $this->add(array( 'name' => 'description', 'required' => false, 'filters' => array( array('name' => 'Moto\Filter\NullValue'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'max' => 160, ), ), ), )); $this->add(array( 'name' => 'noindex', 'required' => false, 'filters' => array( array('name' => 'Boolean'), ), 'validators' => array( array( 'name' => 'InArray', 'options' => array( 'haystack' => array(false, true) ) ), ), )); $this->add(array( 'name' => 'nofollow', 'required' => false, 'filters' => array( array('name' => 'Boolean'), ), 'validators' => array( array( 'name' => 'InArray', 'options' => array( 'haystack' => array(false, true) ) ), ), )); $this->add(array( 'name' => 'hideCanonical', 'required' => false, 'filters' => array( array('name' => 'Boolean'), ), 'validators' => array( array( 'name' => 'InArray', 'options' => array( 'haystack' => array(false, true) ) ), ), )); $this->add(array( 'name' => 'noodp', 'required' => false, 'filters' => array( array('name' => 'Boolean'), ), 'validators' => array( array( 'name' => 'InArray', 'options' => array( 'haystack' => array(false, true) ) ), ), )); $this->add(array( 'name' => 'noydir', 'required' => false, 'filters' => array( array('name' => 'Boolean'), ), 'validators' => array( array( 'name' => 'InArray', 'options' => array( 'haystack' => array(false, true) ) ), ), )); $this->add(array( 'name' => 'canonical_url', 'required' => false, 'filters' => array( array('name' => 'Moto\Filter\NullValue'), array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'max' => 2048, ), ), ), )); $openGraph = new AbstractInputFilter(); $this->add($openGraph, 'og'); $openGraph->add(array( 'name' => 'title', 'required' => false, 'allow_empty' => true, 'filters' => array( array('name' => 'Moto\Filter\NullValue'), array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'max' => 200, ), ), ), )); $openGraph->add(array( 'name' => 'description', 'required' => false, 'allow_empty' => true, 'filters' => array( array('name' => 'Moto\Filter\NullValue'), array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'max' => 160, ), ), ), )); $openGraph->add(array( 'name' => 'url', 'required' => false, 'allow_empty' => true, 'filters' => array( array('name' => 'Moto\Filter\NullValue'), array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'max' => 2048, ), ), ), )); $image = new AbstractInputFilter(); $openGraph->add($image, 'image'); $image->add(array( 'name' => 'id', 'required' => false, 'allow_empty' => true, 'filters' => array( array('name' => 'Moto\Filter\IntValue'), ), )); $image->add(array( 'name' => 'name', 'required' => false, 'allow_empty' => true, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'max' => 512, ), ), ), )); $image->add(array( 'name' => 'size', 'required' => false, 'allow_empty' => true, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'max' => 32, ), ), ), )); $image->add(array( 'name' => 'path', 'required' => false, 'allow_empty' => true, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'max' => 512, ), ), ), )); } } 