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