private function processBreak(array $table, Config $config)
{
if (!$config['break']) {
return [$table];
}
$break = $config['break'];
foreach ($break as $breakKey) {
// remove the break col from the visible cols.
if (false !== ($index = array_search($breakKey, $config['cols']))) {
$cols = $config['cols'];
unset($cols[$index]);
$config['cols'] = $cols;
}
}
return F\group($table, function ($row) use($break) {
$breakHash = [];
foreach ($break as $breakKey) {
$breakHash[] = $breakKey . ': ' . $row[$breakKey];
unset($row[$breakKey]);
}
return implode(', ', $breakHash);
});
}