]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/Form/Type/UserInformationType.php
Fix `findOneByUrl` side effect in tests
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Form / Type / UserInformationType.php
1 <?php
2
3 namespace Wallabag\CoreBundle\Form\Type;
4
5 use Symfony\Component\Form\AbstractType;
6 use Symfony\Component\Form\FormBuilderInterface;
7 use Symfony\Component\OptionsResolver\OptionsResolver;
8
9 class UserInformationType extends AbstractType
10 {
11 public function buildForm(FormBuilderInterface $builder, array $options)
12 {
13 $builder
14 ->add('name', 'text')
15 ->add('email', 'email')
16 ->add('twoFactorAuthentication', 'checkbox', array('required' => false))
17 ->add('save', 'submit')
18 ->remove('username')
19 ->remove('plainPassword')
20 ;
21 }
22
23 public function getParent()
24 {
25 return 'fos_user_registration';
26 }
27
28 public function configureOptions(OptionsResolver $resolver)
29 {
30 $resolver->setDefaults(array(
31 'data_class' => 'Wallabag\UserBundle\Entity\User',
32 ));
33 }
34
35 public function getName()
36 {
37 return 'update_user';
38 }
39 }