Exemplo n.º 1
0
 /**
  * Returns the SQL for a select statement
  *
  * @param SQLStatement $select
  * @return string
  */
 public function select(SQLStatement $select) : string
 {
     $sql = $select->getDistinct() ? 'SELECT DISTINCT ' : 'SELECT ';
     $sql .= $this->handleColumns($select->getColumns());
     $sql .= $this->handleInto($select->getIntoTable(), $select->getIntoDatabase());
     $sql .= ' FROM ';
     $sql .= $this->handleTables($select->getTables());
     $sql .= $this->handleJoins($select->getJoins());
     $sql .= $this->handleWheres($select->getWheres());
     $sql .= $this->handleGroupings($select->getGroupBy());
     $sql .= $this->handleOrderings($select->getOrder());
     $sql .= $this->handleHavings($select->getHaving());
     $sql .= $this->handleLimit($select->getLimit());
     $sql .= $this->handleOffset($select->getOffset());
     return $sql;
 }