added $options field and get() set() methods for it
This commit is contained in:
parent
39e5782a93
commit
47b88cbac6
|
@ -8,6 +8,20 @@ use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
|||
|
||||
class ##CLASS## extends AbstractType
|
||||
{
|
||||
private $options = array(
|
||||
'data_class' => '##FQCN##',
|
||||
);
|
||||
|
||||
public function set($name, $value)
|
||||
{
|
||||
$this->options[$name] = $value;
|
||||
}
|
||||
|
||||
public function get($name)
|
||||
{
|
||||
return $this->options[$name];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -20,9 +34,7 @@ class ##CLASS## extends AbstractType
|
|||
*/
|
||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => '##FQCN##',
|
||||
));
|
||||
$resolver->setDefaults($this->options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue