Skip to content

Instantly share code, notes, and snippets.

@awartoft
Created July 9, 2012 12:35
Show Gist options
  • Save awartoft/3076223 to your computer and use it in GitHub Desktop.
Save awartoft/3076223 to your computer and use it in GitHub Desktop.
<?php
/**
* @author Antoine Hedgecock <[email protected]>
*/
/**
* @namespace
*/
namespace Article\Form\Fieldsets;
use Zend\Form\Fieldset,
Zend\InputFilter\InputFilterProviderInterface;
class KeywordRelationFieldset extends Fieldset implements InputFilterProviderInterface
{
public function __construct()
{
parent::__construct('article_relation_keyword');
$this->setObject(new \Article\Entity\Article\Category())
->setHydrator(new \Zend\Stdlib\Hydrator\ClassMethods());
$this->add(
array(
'name' => 'id'
)
);
}
/**
* Should return an array specification compatible with
* {@link Zend\InputFilter\Factory::createInputFilter()}.
*
* @return array
*/
public function getInputFilterSpecification()
{
return array(
'id' => array(
'required' => true
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment