1 | <?php |
||
16 | class DTOFormElement extends FormElement |
||
17 | { |
||
18 | public function getClassName() |
||
19 | { |
||
20 | return 'FSi\FixturesBundle\DTO\Model'; |
||
21 | } |
||
22 | |||
23 | public function getId() |
||
24 | { |
||
25 | return 'dto_form'; |
||
26 | } |
||
27 | |||
28 | public function save($object) |
||
29 | { |
||
30 | } |
||
31 | |||
32 | protected function initForm(FormFactoryInterface $factory, $data = null) |
||
33 | { |
||
34 | $builder = $factory->createNamedBuilder( |
||
35 | 'dto_form', |
||
36 | TypeSolver::getFormType('Symfony\Component\Form\Extension\Core\Type\FormType', 'form'), |
||
37 | $data, |
||
38 | ['data_class' => $this->getClassName()] |
||
39 | ); |
||
40 | |||
41 | $builder->add( |
||
42 | 'email', |
||
43 | TypeSolver::getFormType('Symfony\Component\Form\Extension\Core\Type\EmailType', 'email'), |
||
44 | ['label' => 'admin.email'] |
||
45 | ); |
||
46 | |||
47 | return $builder->getForm(); |
||
48 | } |
||
49 | } |
||
50 |