Example #1
0
 public function sqlBase()
 {
     $cmdWhere = '';
     $this->_binds = array();
     if ($this->_where instanceof ZendT_Db_Table_Select) {
         $cmdWhere = $this->_where->getSqlWhere();
         $this->_binds = $this->_where->getBinds();
     }
     $commands = $this->getCommands();
     $sql = 'SELECT ' . $commands['columns'];
     $sql .= '  FROM ' . $this->_table->getTableName() . ' "' . $this->_table->getTableAlias() . '" ';
     $sql .= ' ' . $commands['join'];
     $sql .= ' WHERE 1 = 1 ';
     $sql .= $cmdWhere;
     if ($this->_order) {
         $sql .= ' ORDER BY ' . $this->_order;
     }
     print $sql;
     return $sql;
 }