有没有像_compile_select或get_compiled_select()函数? [英] Is there a function like _compile_select or get_compiled_select()?

查看:567
本文介绍了有没有像_compile_select或get_compiled_select()函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来 _compile_select 是德precated和 get_compiled_select 未添加到2.1.0。是否还有其他的功能,比如那两个?而且我也很好奇。有什么特别的理由不加入 get_compiled_select()来活动记录和删除 _compile_select

Looks like _compile_select is deprecated and get_compiled_select is not added to 2.1.0. Are there any other functions like those two? And also I am curious. Is there any particular reason to not adding get_compiled_select() to Active Record and removing _compile_select?

推荐答案

我添加get_compiled_select()来DB_active_rec.php,它似乎没有问题的工作,但因为它是在许多用我不会删除_compile_select()其它方法

I've added get_compiled_select() to DB_active_rec.php and it seems to work without problem, but i wouldn't remove _compile_select() since it's used in many other methods.

添加此方法的拉动请求是在这里,像其他一些有用的方法:

The pull request for adding this method is here, with some other useful methods like:

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

<一个href="https://github.com/EllisLab/$c$cIgniter/pull/307">https://github.com/EllisLab/$c$cIgniter/pull/307

如果你只想在方法,它只是这样的:

if you want just the method, it's just this:

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

这篇关于有没有像_compile_select或get_compiled_select()函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆