Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
55 / 55 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
RequestConcernedPeopleType | |
100.00% |
55 / 55 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
buildForm | |
100.00% |
48 / 48 |
|
100.00% |
1 / 1 |
1 | |||
configureOptions | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | /** |
4 | * This file is part of the MADIS - RGPD Management application. |
5 | * |
6 | * @copyright Copyright (c) 2018-2019 Soluris - Solutions Numériques Territoriales Innovantes |
7 | * |
8 | * This program is free software: you can redistribute it and/or modify |
9 | * it under the terms of the GNU Affero General Public License as published by |
10 | * the Free Software Foundation, either version 3 of the License, or |
11 | * (at your option) any later version. |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU Affero General Public License for more details. |
17 | * |
18 | * You should have received a copy of the GNU Affero General Public License |
19 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
20 | */ |
21 | |
22 | declare(strict_types=1); |
23 | |
24 | namespace App\Domain\Registry\Form\Type\Embeddable; |
25 | |
26 | use App\Domain\Registry\Model\Embeddable\RequestConcernedPeople; |
27 | use Knp\DictionaryBundle\Form\Type\DictionaryType; |
28 | use Symfony\Component\Form\AbstractType; |
29 | use Symfony\Component\Form\Extension\Core\Type\EmailType; |
30 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
31 | use Symfony\Component\Form\FormBuilderInterface; |
32 | use Symfony\Component\OptionsResolver\OptionsResolver; |
33 | |
34 | class RequestConcernedPeopleType extends AbstractType |
35 | { |
36 | /** |
37 | * Build type form. |
38 | */ |
39 | public function buildForm(FormBuilderInterface $builder, array $options) |
40 | { |
41 | $builder |
42 | ->add('civility', DictionaryType::class, [ |
43 | 'label' => 'global.label.contact.civility', |
44 | 'required' => false, |
45 | 'name' => 'registry_request_civility', |
46 | ]) |
47 | ->add('firstName', TextType::class, [ |
48 | 'label' => 'global.label.contact.first_name', |
49 | 'required' => false, |
50 | 'attr' => [ |
51 | 'maxlength' => 255, |
52 | ], |
53 | 'purify_html' => true, |
54 | ]) |
55 | ->add('lastName', TextType::class, [ |
56 | 'label' => 'global.label.contact.last_name', |
57 | 'required' => false, |
58 | 'attr' => [ |
59 | 'maxlength' => 255, |
60 | ], |
61 | 'purify_html' => true, |
62 | ]) |
63 | ->add('address', TextType::class, [ |
64 | 'label' => 'global.label.address.line_one', |
65 | 'required' => false, |
66 | 'attr' => [ |
67 | 'maxlength' => 255, |
68 | ], |
69 | 'purify_html' => true, |
70 | ]) |
71 | ->add('mail', EmailType::class, [ |
72 | 'label' => 'global.label.contact.email', |
73 | 'required' => false, |
74 | ]) |
75 | ->add('phoneNumber', TextType::class, [ |
76 | 'label' => 'global.label.contact.phone_number', |
77 | 'required' => false, |
78 | 'purify_html' => true, |
79 | ]) |
80 | ->add('linkWithApplicant', TextType::class, [ |
81 | 'label' => 'registry.request.label.link_with_applicant', |
82 | 'required' => false, |
83 | 'attr' => [ |
84 | 'maxlength' => 255, |
85 | ], |
86 | 'purify_html' => true, |
87 | ]) |
88 | ; |
89 | } |
90 | |
91 | /** |
92 | * Provide type options. |
93 | */ |
94 | public function configureOptions(OptionsResolver $resolver) |
95 | { |
96 | $resolver |
97 | ->setDefaults([ |
98 | 'data_class' => RequestConcernedPeople::class, |
99 | 'validation_groups' => [ |
100 | 'default', |
101 | ], |
102 | ]); |
103 | } |
104 | } |