FixDisabledBugOptionsBuilder::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 7
rs 9.4285
c 1
b 0
f 1
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace steevanb\SymfonyFormOptionsBuilder\OptionsBuilder;
4
5
/**
6
 * Use it to fix disabled configuration bug :
7
 * If all your fields are disabled, your browser doesn't send anything
8
 * In this case, Symfony understand that you want to delete element, instead of do not modify it.
9
 * You have to call form_widget(form.foo) in your template to write this input in HTML
10
 */
11
class FixDisabledBugOptionsBuilder extends HiddenOptionsBuilder
12
{
13
    public function __construct()
14
    {
15
        $this
16
            ->setMapped(false)
17
            ->setLabel(false)
18
            ->setTranslationDomain(false);
19
    }
20
}
21