Completed
Push — master ( 1dd400...cdfa80 )
by Alexey
04:26
created

Map::parseRequest()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 9
Code Lines 7

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
cc 3
eloc 7
nc 4
nop 1
dl 9
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Active form input files
5
 *
6
 * @author Alexey Krupskiy <[email protected]>
7
 * @link http://inji.ru/
8
 * @copyright 2015 Alexey Krupskiy
9
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
10
 */
11
12
namespace Ui\ActiveForm\Input;
13
14
class Map extends \Ui\ActiveForm\Input {
15
16 View Code Duplication
  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