Codeigniter 是否有类似于_compile_select或get_compiled_select()的函数?

Codeigniter 是否有类似于_compile_select或get_compiled_select()的函数?,codeigniter,activerecord,codeigniter-2,Codeigniter,Activerecord,Codeigniter 2,看起来\u compile\u select已被弃用,而get\u compiled\u select未添加到2.1.0中。还有其他类似的功能吗?我也很好奇。有没有什么特别的理由不向活动记录添加get\u compiled\u select()并删除\u compile\u select?我已经将get\u compiled\u select()添加到DB\u Active\u rec.php中,它似乎可以正常工作,但我不会删除它,因为它在许多其他方法中都有使用 此处是添加此方法的pull请求,

看起来
\u compile\u select
已被弃用,而
get\u compiled\u select
未添加到2.1.0中。还有其他类似的功能吗?我也很好奇。有没有什么特别的理由不向活动记录添加
get\u compiled\u select()
并删除
\u compile\u select

我已经将get\u compiled\u select()添加到DB\u Active\u rec.php中,它似乎可以正常工作,但我不会删除它,因为它在许多其他方法中都有使用

此处是添加此方法的pull请求,还有一些其他有用的方法,如:

  • 获取已编译的\u选择()
  • 获取已编译的\u插入()
  • 获取已编译的\u更新()
  • get_compiled_delete()

如果您只需要该方法,它就是:

/**
 * 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;
}