Skip to content

Commit af33dc5

Browse files
authored
Fix Support to GroupFooter
1 parent eb8f43d commit af33dc5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Detail.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,21 @@ public function generate($obj = null) {
104104
$recordObject = array_key_exists('recordObj', $arrayVariable) ? $obj->arrayVariable['recordObj']['initialValue'] : "stdClass";
105105
$obj->lastRowData = $obj->rowData;
106106
$row = ( is_array($dbData) || $dbData instanceOf \ArrayAccess ) ? (isset($dbData[$rowIndex])) ? $dbData[$rowIndex] : null : $dbData->fetchObject($recordObject);
107+
if (!is_object($row) && is_array($row)) {
108+
$row = (object)$row;
109+
}
107110
//echo $rowIndex;
111+
if (count($obj->arrayGroup) > 0) {
112+
foreach ($obj->arrayGroup as $group) {
113+
preg_match_all("/F{(\w+)}/", $group->groupExpression, $matchesF);
114+
$groupExpression = $matchesF[1][0];
115+
if ($obj->rowData->$groupExpression != $row->$groupExpression && $group->groupFooter) {
116+
$groupFooter = new GroupFooter($group->groupFooter);
117+
$groupFooter->generate(array($obj, $obj->rowData));
118+
$group->resetVariables = 'true';
119+
}
120+
}
121+
}
108122

109123
$obj->rowData = $row;
110124
$obj->variables_calculation($obj, $row);

0 commit comments

Comments
 (0)