/** * Parses SELECT statement. * @return string */ protected function parseSelectStmt() { $cols = $this->stmt->getColumns(); list($source, $where, $group, $order) = $this->clauses; foreach ($cols as $key => $col) { $col = preg_match('~^[\\w.]+$~', $col) ? ":{$col}" : $col; $cols[$key] = $this->tryDelimite($col); } $cols = implode(', ', $cols); return $this->applyLimit("SELECT {$cols}\nFROM " . $source . $where . $group . $order); }