2012-02-10 86 views

回答

13

我已經將get_compiled_select()添加到DB_active_rec.php,它似乎沒有問題,但我不會刪除_compile_select(),因爲它在許多其他方法中使用。

添加此方法的拉動請求是在這裏,與像其他一些有用的方法:

  • get_compiled_select()
  • get_compiled_insert()
  • get_compiled_update()
  • get_compiled_delete()

https://github.com/EllisLab/CodeIgniter/pull/307

如果你只是想要的方法,它只是這樣的:

/** 
* Get SELECT query string 
* 
* Compiles a SELECT query string and returns the sql. 
* 
* @access public 
* @param string the table name to select from (optional) 
* @param boolean TRUE: resets AR values; FALSE: leave AR vaules alone 
* @return string 
*/ 
public function get_compiled_select($table = '', $reset = TRUE) 
{ 
    if ($table != '') 
    { 
     $this->_track_aliases($table); 
     $this->from($table); 
    } 

    $select = $this->_compile_select(); 

    if ($reset === TRUE) 
    { 
     $this->_reset_select(); 
    } 

    return $select; 
} 
相關問題