Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 62 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
ModeleScenarioMenaceType | |
0.00% |
0 / 62 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
buildForm | |
0.00% |
0 / 59 |
|
0.00% |
0 / 1 |
2 | |||
configureOptions | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace App\Domain\AIPD\Form\Type; |
6 | |
7 | use App\Domain\AIPD\Model\ModeleMesureProtection; |
8 | use App\Domain\AIPD\Model\ModeleScenarioMenace; |
9 | use Knp\DictionaryBundle\Form\Type\DictionaryType; |
10 | use Symfony\Bridge\Doctrine\Form\Type\EntityType; |
11 | use Symfony\Component\Form\AbstractType; |
12 | use Symfony\Component\Form\Extension\Core\Type\CheckboxType; |
13 | use Symfony\Component\Form\Extension\Core\Type\TextareaType; |
14 | use Symfony\Component\Form\FormBuilderInterface; |
15 | use Symfony\Component\OptionsResolver\OptionsResolver; |
16 | |
17 | class ModeleScenarioMenaceType extends AbstractType |
18 | { |
19 | public function buildForm(FormBuilderInterface $builder, array $options) |
20 | { |
21 | $builder |
22 | ->add('nom', TextareaType::class, [ |
23 | 'label' => false, |
24 | 'attr' => [ |
25 | 'maxlength' => 1000, |
26 | 'rows' => 1, |
27 | 'class' => 'textareaheight', |
28 | ], |
29 | 'purify_html' => true, |
30 | ]) |
31 | ->add('mesuresProtections', EntityType::class, [ |
32 | 'required' => false, |
33 | 'label' => false, |
34 | 'multiple' => true, |
35 | 'expanded' => false, |
36 | 'class' => ModeleMesureProtection::class, |
37 | 'attr' => [ |
38 | 'class' => 'selectpicker', |
39 | 'data-live-search' => 'true', |
40 | 'title' => 'global.placeholder.multiple_select', |
41 | ], |
42 | ]) |
43 | ->add('isVisible', CheckboxType::class, [ |
44 | 'required' => false, |
45 | 'label' => false, |
46 | ]) |
47 | ->add('isDisponibilite', CheckboxType::class, [ |
48 | 'required' => false, |
49 | 'label' => false, |
50 | ]) |
51 | ->add('isIntegrite', CheckboxType::class, [ |
52 | 'required' => false, |
53 | 'label' => false, |
54 | ]) |
55 | ->add('isConfidentialite', CheckboxType::class, [ |
56 | 'required' => false, |
57 | 'label' => false, |
58 | ]) |
59 | ->add('vraisemblance', DictionaryType::class, [ |
60 | 'required' => true, |
61 | 'name' => 'modele_vraisemblance_gravite', |
62 | 'label' => false, |
63 | ]) |
64 | ->add('gravite', DictionaryType::class, [ |
65 | 'required' => true, |
66 | 'name' => 'modele_vraisemblance_gravite', |
67 | 'label' => false, |
68 | ]) |
69 | ->add('precisions', TextareaType::class, [ |
70 | 'required' => false, |
71 | 'label' => false, |
72 | 'attr' => [ |
73 | 'maxlength' => 1000, |
74 | 'rows' => 1, |
75 | 'class' => 'textareaheight', |
76 | ], |
77 | 'purify_html' => true, |
78 | ]) |
79 | ; |
80 | } |
81 | |
82 | public function configureOptions(OptionsResolver $resolver) |
83 | { |
84 | $resolver->setDefaults([ |
85 | 'data_class' => ModeleScenarioMenace::class, |
86 | ]); |
87 | } |
88 | } |