Conditions | 2 |
Paths | 1 |
Total Lines | 37 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
41 | private function initAfterRow(): void |
||
42 | { |
||
43 | /** |
||
44 | * @param Charge $obj |
||
45 | * @return string |
||
46 | */ |
||
47 | $this->afterRow = function (Charge $obj) { |
||
48 | $model = $this->chargesByMainObject[$obj->common_object_id]; |
||
49 | if (empty($model)) { |
||
50 | return ''; |
||
51 | } |
||
52 | return GroupedChargesGridView::widget([ |
||
53 | 'boxed' => false, |
||
54 | 'showHeader' => true, |
||
55 | 'showFooter' => false, |
||
56 | 'options' => [ |
||
57 | 'tag' => 'tr', |
||
58 | 'id' => crc32($model->id ?? microtime(true)), |
||
59 | ], |
||
60 | 'layout' => '<td colspan="' . \count($this->columns) . '">{items}</td>', |
||
61 | 'dataProvider' => new ArrayDataProvider([ |
||
62 | 'allModels' => ChargeSort::anyCharges() |
||
63 | ->values($model, true), |
||
64 | 'sort' => false, |
||
65 | 'pagination' => false |
||
66 | ]), |
||
67 | 'filterModel' => $model, |
||
68 | 'tableOptions' => [ |
||
69 | 'class' => 'table table-striped table-bordered' |
||
70 | ], |
||
71 | 'columns' => [ |
||
72 | 'type_label', 'label', |
||
73 | 'quantity', 'sum', 'sum_with_children', 'time', |
||
74 | ], |
||
75 | ]); |
||
76 | }; |
||
77 | } |
||
78 | } |
||
79 |