DoctrineStepType.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Bundle\WebConfiguratorBundle\Form;
  11. use Symfony\Bundle\WebConfiguratorBundle\Step\DoctrineStep;
  12. use Symfony\Component\Form\AbstractType;
  13. use Symfony\Component\Form\FormBuilder;
  14. /**
  15. * Doctrine Form Type.
  16. *
  17. * @author Fabien Potencier <fabien@symfony.com>
  18. */
  19. class DoctrineStepType extends AbstractType
  20. {
  21. public function buildForm(FormBuilder $builder, array $options)
  22. {
  23. $builder
  24. ->add('driver', 'choice', array('choices' => DoctrineStep::getDrivers()))
  25. ->add('name', 'text')
  26. ->add('host', 'text')
  27. ->add('user', 'text')
  28. ->add('password', 'repeated', array(
  29. 'required' => false,
  30. 'type' => 'password',
  31. 'first_name' => 'Password',
  32. 'second_name' => 'Password again',
  33. ))
  34. ;
  35. }
  36. }