Code Duplication    Length = 9-12 lines in 2 locations

system/modules/Ui/objects/ActiveForm/Input/Map.php 1 location

@@ 16-24 (lines=9) @@
13
14
class Map extends \Ui\ActiveForm\Input {
15
16
    public function parseRequest($request) {
17
        $colName = empty($this->colParams['col']) ? $this->colName : $this->colParams['col'];
18
        if (isset($request[$this->colName])) {
19
            $this->activeForm->model->{$colName} = json_encode($request[$this->colName]);
20
        } else {
21
            $this->activeForm->model->{$colName} = 0;
22
            $this->activeForm->model->{$colName} = '';
23
        }
24
    }
25
26
}
27

system/modules/Ui/objects/ActiveForm/Input.php 1 location

@@ 44-55 (lines=12) @@
41
        return true;
42
    }
43
44
    public function parseRequest($request) {
45
        if ($this->readOnly()) {
46
            return false;
47
        }
48
        $colName = empty($this->colParams['col']) ? $this->colName : $this->colParams['col'];
49
        if (isset($request[$this->colName])) {
50
            $this->activeForm->model->{$colName} = $request[$this->colName];
51
        } else {
52
            $this->activeForm->model->{$colName} = 0;
53
            $this->activeForm->model->{$colName} = '';
54
        }
55
    }
56
57
    public function value() {
58
        $value = isset($this->colParams['default']) ? $this->colParams['default'] : '';