Add configureOptions method to form types for SF 2.7

This commit is contained in:
StudioMaX 2015-07-09 22:19:21 +06:00
parent 8d3ee7334f
commit 2e49f50c1a
1 changed files with 11 additions and 1 deletions

View File

@ -7,6 +7,7 @@ use Symfony\Component\Form\FormView;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Translation\TranslatorInterface;
@ -122,12 +123,21 @@ class CaptchaType extends AbstractType
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$this->options['mapped'] = false;
$resolver->setDefaults($this->options);
}
/**
* {@inheritdoc}
* BC for SF < 2.7
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$this->configureOptions($resolver);
}
/**
* @return string
*/