]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | ||
3 | namespace Wallabag\CoreBundle\Form\Type; | |
4 | ||
5 | use Symfony\Component\Form\AbstractType; | |
6 | use Symfony\Component\Form\Extension\Core\Type\CheckboxType; | |
7 | use Symfony\Component\Form\Extension\Core\Type\EmailType; | |
8 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; | |
9 | use Symfony\Component\Form\Extension\Core\Type\TextType; | |
10 | use Symfony\Component\Form\FormBuilderInterface; | |
11 | use Symfony\Component\OptionsResolver\OptionsResolver; | |
12 | ||
13 | class UserInformationType extends AbstractType | |
14 | { | |
15 | public function buildForm(FormBuilderInterface $builder, array $options) | |
16 | { | |
17 | $builder | |
18 | ->add('name', TextType::class) | |
19 | ->add('email', EmailType::class) | |
20 | ->add('twoFactorAuthentication', CheckboxType::class, array('required' => false)) | |
21 | ->add('save', SubmitType::class) | |
22 | ->remove('username') | |
23 | ->remove('plainPassword') | |
24 | ; | |
25 | } | |
26 | ||
27 | public function getParent() | |
28 | { | |
29 | return 'FOS\UserBundle\Form\Type\RegistrationFormType'; | |
30 | } | |
31 | ||
32 | public function configureOptions(OptionsResolver $resolver) | |
33 | { | |
34 | $resolver->setDefaults(array( | |
35 | 'data_class' => 'Wallabag\UserBundle\Entity\User', | |
36 | )); | |
37 | } | |
38 | ||
39 | public function getBlockPrefix() | |
40 | { | |
41 | return 'update_user'; | |
42 | } | |
43 | } |