private function generateSQL(&$sql, $from, $joins, $where, $having, $group, $values) {
        $froms = [];
        foreach ($from as $f) {
            $froms [] = $f [0] . ' AS ' . $f [1];
        }
        $sql [] = implode(',', $froms);
        if ($joins) {
            foreach ($joins as $join) {
                $sql [] = $join [2] . ' ' . $join [0] . ' AS ' . $join [3] . ' ON (' . $join [1] . ')';
            }
        }
        if ($where && count($where) > 0) {
            $sql [] = 'WHERE ' . $where->getWhereCondition($this, $values);
        }
        if ($group) {
            $sql [] = 'GROUP BY ' . implode(' , ', $group);
        }
        if ($having) {
            $sql [] = 'HAVING ' . implode(' AND ', $having);
        }
    }
private function generateSQL(&$sql, $from, $joins, $where, $having, $group, $values) {
        $froms = [];
        foreach ($from as $f) {
            $froms [] = $f [0] . ' AS ' . $f [1];
        }
        $sql [] = implode(',', $froms);
        if ($joins) {
            foreach ($joins as $join) {
                $sql [] = $join [2] . ' ' . $join [0] . ' AS ' . $join [3] . ' ON (' . $join [1] . ')';
            }
        }
        if ($where && count($where) > 0) {
            $sql [] = 'WHERE ' . $where->getWhereCondition($this, $values);
        }
        if ($group) {
            $sql [] = 'GROUP BY ' . implode(' , ', $group);
        }
        if ($having) {
            $sql [] = 'HAVING ' . implode(' AND ', $having);
        }
    }
private function generateSQL ( & $ sql , $ from , $ joins , $ where , $ having , $ group , $ values ) { $ froms = [ ] ; foreach ( $ from as $ f ) { $ froms [ ] = $ f [ 0 ] . ' AS ' . $ f [ 1 ] ; } $ sql [ ] = implode ( ',' , $ froms ) ; if ( $ joins ) { foreach ( $ joins as $ join ) { $ sql [ ] = $ join [ 2 ] . ' ' . $ join [ 0 ] . ' AS ' . $ join [ 3 ] . ' ON (' . $ join [ 1 ] . ')' ; } } if ( $ where && count ( $ where ) > 0 ) { $ sql [ ] = 'WHERE ' . $ where -> getWhereCondition ( $ this , $ values ) ; } if ( $ group ) { $ sql [ ] = 'GROUP BY ' . implode ( ' , ' , $ group ) ; } if ( $ having ) { $ sql [ ] = 'HAVING ' . implode ( ' AND ' , $ having ) ; } }
generate the common SQL for select and select count

@param array      $sql
@param array      $from
@param array      $joins
@param Condition  $where
@param array      $having
@param array      $group
@param BindValues $values
generate the common SQL for select and select count