10
看起來像_compile_select
已棄用,get_compiled_select
未添加到2.1.0。還有其他的功能嗎?而且我很好奇。是否有任何特殊原因未將get_compiled_select()
添加到Active Record並刪除_compile_select
?是否有像_compile_select或get_compiled_select()這樣的函數?
看起來像_compile_select
已棄用,get_compiled_select
未添加到2.1.0。還有其他的功能嗎?而且我很好奇。是否有任何特殊原因未將get_compiled_select()
添加到Active Record並刪除_compile_select
?是否有像_compile_select或get_compiled_select()這樣的函數?
我已經將get_compiled_select()添加到DB_active_rec.php,它似乎沒有問題,但我不會刪除_compile_select(),因爲它在許多其他方法中使用。
添加此方法的拉動請求是在這裏,與像其他一些有用的方法:
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;
}