method getGroupBy documentation in bbn\Db\Languages\Sql
Returns a string with the GROUP BY part of the query if there is, empty otherwise
function(array $cfg)
{
$res = '';
$group_to_put = [];
if (!empty($cfg['group_by'])) {
foreach ($cfg['group_by'] as $g) {
if (isset($cfg['available_fields'][$g])) {
$group_to_put[] = $this->escape($g);
} else {
$this->error("Error! The column '$g' doesn't exist for group by " . print_r($cfg, true), false);
}
}
if (count($group_to_put)) {
$res .= 'GROUP BY ' . implode(', ', $group_to_put) . PHP_EOL;
}
}
return $res;
}
Returns a string with the GROUP BY part of the query if there is, empty otherwise BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2023
BBN Solutions