Total Complexity | 9 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
13 | class Hook extends TypesHook |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @param $row |
||
18 | * @param $column DatetimeModel |
||
19 | * @return mixed |
||
20 | */ |
||
21 | public function indexRender($row, $column) |
||
22 | { |
||
23 | if($column->getFormat()) { |
||
24 | $datetime = date_create_from_format($column->getFormat(), $value); |
||
|
|||
25 | return $datetime ? $datetime->format('Y-m-d H:i:s') : $value; |
||
26 | }else{ |
||
27 | return $row->{$column->getField()}; |
||
28 | } |
||
29 | } |
||
30 | |||
31 | public function assignment($value, $column) |
||
32 | { |
||
33 | if($column->getFormat()) { |
||
34 | return date_create_from_format($column->getFormat(), $value)->format('Y-m-d H:i:s'); |
||
35 | } else { |
||
36 | return $value; |
||
37 | } |
||
38 | } |
||
39 | |||
40 | public function detailRender($row, $column) |
||
43 | } |
||
44 | |||
45 | public function filterQuery($query, $column, $value) |
||
57 |