src/Query/Select.php
private function parseGroup()
    {
        $group = '';
        if (isset($this->parts['group']['fields'])) {
            if (is_array($this->parts['group']['fields'])) {
                $groupFields = [];
                foreach ($this->parts['group']['fields'] as $field) {
                    $field = is_array($field) ? $field : [$field];
                    $column = isset($field[0]) ? $field[0] : false;
                    $type = isset($field[1]) ? $field[1] : '';

                    $groupFields[] = $this->protect($column).($type ? ' '.strtoupper($type) : '');
                }

                $group .= implode(', ', $groupFields);
            } else {
                $group .= $this->parts['group']['fields'];
            }
        }

        if (isset($this->parts['group']['rollup']) && $this->parts['group']['rollup'] !== false) {
            $group .= ' WITH ROLLUP';
        }

        return $group;
    }
private function parseGroup()
    {
        $group = '';
        if (isset($this->parts['group']['fields'])) {
            if (is_array($this->parts['group']['fields'])) {
                $groupFields = [];
                foreach ($this->parts['group']['fields'] as $field) {
                    $field = is_array($field) ? $field : [$field];
                    $column = isset($field[0]) ? $field[0] : false;
                    $type = isset($field[1]) ? $field[1] : '';

                    $groupFields[] = $this->protect($column).($type ? ' '.strtoupper($type) : '');
                }

                $group .= implode(', ', $groupFields);
            } else {
                $group .= $this->parts['group']['fields'];
            }
        }

        if (isset($this->parts['group']['rollup']) && $this->parts['group']['rollup'] !== false) {
            $group .= ' WITH ROLLUP';
        }

        return $group;
    }
private function parseGroup ( ) { $ group = '' ; if ( isset ( $ this -> parts [ 'group' ] [ 'fields' ] ) ) { if ( is_array ( $ this -> parts [ 'group' ] [ 'fields' ] ) ) { $ groupFields = [ ] ; foreach ( $ this -> parts [ 'group' ] [ 'fields' ] as $ field ) { $ field = is_array ( $ field ) ? $ field : [ $ field ] ; $ column = isset ( $ field [ 0 ] ) ? $ field [ 0 ] : false ; $ type = isset ( $ field [ 1 ] ) ? $ field [ 1 ] : '' ; $ groupFields [ ] = $ this -> protect ( $ column ) . ( $ type ? ' ' . strtoupper ( $ type ) : '' ) ; } $ group .= implode ( ', ' , $ groupFields ) ; } else { $ group .= $ this -> parts [ 'group' ] [ 'fields' ] ; } } if ( isset ( $ this -> parts [ 'group' ] [ 'rollup' ] ) && $ this -> parts [ 'group' ] [ 'rollup' ] !== false ) { $ group .= ' WITH ROLLUP' ; } return $ group ; }
Parses GROUP entries

@uses $this->group['fields'] array with elements to group by
@return string
Parses GROUP entries