Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 34 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
ShelfLifeType | |
0.00% |
0 / 34 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
buildForm | |
0.00% |
0 / 27 |
|
0.00% |
0 / 1 |
2 | |||
configureOptions | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace App\Domain\Registry\Form\Type; |
4 | |
5 | use App\Domain\Registry\Model\ShelfLife; |
6 | use Knp\DictionaryBundle\Form\Type\DictionaryType; |
7 | use Symfony\Component\Form\AbstractType; |
8 | use Symfony\Component\Form\Extension\Core\Type\TextareaType; |
9 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
10 | use Symfony\Component\Form\FormBuilderInterface; |
11 | use Symfony\Component\OptionsResolver\OptionsResolver; |
12 | |
13 | class ShelfLifeType extends AbstractType |
14 | { |
15 | public function buildForm(FormBuilderInterface $builder, array $options) |
16 | { |
17 | $builder |
18 | ->add('name', TextType::class, [ |
19 | 'label' => 'registry.treatment.label.shelflife_name', |
20 | 'required' => true, |
21 | 'empty_data' => '', |
22 | 'attr' => [ |
23 | 'maxlength' => 255, |
24 | ], |
25 | 'purify_html' => true, |
26 | ]) |
27 | ->add('duration', TextareaType::class, [ |
28 | 'label' => 'registry.treatment.label.shelflife_duration', |
29 | 'required' => true, |
30 | 'empty_data' => '', |
31 | 'attr' => [ |
32 | 'maxlength' => 500, |
33 | 'rows' => 1, |
34 | 'class' => 'textareaheight', |
35 | ], |
36 | 'purify_html' => true, |
37 | ]) |
38 | ->add('ultimate_fate', DictionaryType::class, [ |
39 | 'label' => 'registry.treatment.label.shelflife_ultimate_fate', |
40 | 'required' => true, |
41 | 'name' => 'registry_treatment_ultimate_fate', |
42 | ]) |
43 | ; |
44 | } |
45 | |
46 | /** |
47 | * Provide type options. |
48 | */ |
49 | public function configureOptions(OptionsResolver $resolver) |
50 | { |
51 | $resolver |
52 | ->setDefaults([ |
53 | 'data_class' => ShelfLife::class, |
54 | 'validation_groups' => [ |
55 | 'default', |
56 | ], |
57 | ]); |
58 | } |
59 | } |