1 | <?php |
||
21 | class ColumnValueMapper |
||
22 | { |
||
23 | /** |
||
24 | * @var array column definitions from GridView |
||
25 | */ |
||
26 | protected $columns = []; |
||
27 | /** |
||
28 | * @var array the exportable column names |
||
29 | */ |
||
30 | protected $exportableColumns = []; |
||
31 | /** |
||
32 | * @var bool whether we render HTML or not |
||
33 | */ |
||
34 | protected $isHtml; |
||
35 | |||
36 | /** |
||
37 | * ColumnValueMapper constructor. |
||
38 | * |
||
39 | * @param array $columns |
||
40 | * @param array $exportableColumns |
||
41 | * @param bool $isHtml whether we need to render HTML or not |
||
42 | */ |
||
43 | public function __construct(array $columns, array $exportableColumns = [], $isHtml = false) |
||
49 | |||
50 | /** |
||
51 | * Fetch data from the data provider and create the rows array |
||
52 | * |
||
53 | * @param mixed $model |
||
54 | * @param $index |
||
55 | * |
||
56 | * @return array |
||
57 | */ |
||
58 | public function map($model, $index) |
||
77 | |||
78 | protected function getColumnValue($column, $model, $key, $index) |
||
87 | |||
88 | /** |
||
89 | * Returns column headers |
||
90 | * |
||
91 | * @param $model |
||
92 | * |
||
93 | * @return array |
||
94 | */ |
||
95 | public function getHeaders($model) |
||
107 | |||
108 | /** |
||
109 | * Checks whether the column is exportable or not |
||
110 | * |
||
111 | * @param Column $column |
||
112 | * |
||
113 | * @return bool |
||
114 | */ |
||
115 | protected function isColumnExportable($column) |
||
127 | |||
128 | /** |
||
129 | * Gets columns header |
||
130 | * |
||
131 | * @param $column |
||
132 | * @param $model |
||
133 | * |
||
134 | * @return string |
||
135 | */ |
||
136 | protected function getColumnHeader($column) |
||
145 | } |
||
146 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.