src/hathoora/grid/grid.php
public static function sqlBuildGroupBy($arrGroup, $addGroup = false)
    {
        $groupBy = $group = null;
        
        if (is_array($arrGroup))
        {
            $group = '';
            foreach ($arrGroup as $k)
            {
                if ($group)  $group .= ', ';
                $group .= self::getDSN()->escape($k);
            }
        }
        
        if ($addGroup && $group)
            $groupBy = ' GROUP BY ' . $group;
        
        return $groupBy;    
    }
public static function sqlBuildGroupBy($arrGroup, $addGroup = false)
    {
        $groupBy = $group = null;
        
        if (is_array($arrGroup))
        {
            $group = '';
            foreach ($arrGroup as $k)
            {
                if ($group)  $group .= ', ';
                $group .= self::getDSN()->escape($k);
            }
        }
        
        if ($addGroup && $group)
            $groupBy = ' GROUP BY ' . $group;
        
        return $groupBy;    
    }
Builds group by statement..

@param array $arrGroup
ex:
array('user_id' => 'user_id'),
array('user_id' => 'user_id', 'date' => 'date'),
@param bool $addGroup syntax