2012-02-10 5 views
10

_compile_select은 더 이상 사용되지 않으며, get_compiled_select은 2.1.0에 추가되지 않습니다. 그 둘과 같은 다른 기능이 있습니까? 그리고 또한 호기심이 많습니다. 액티브 레코드에 get_compiled_select()을 추가하고 _compile_select을 삭제하지 않는 특별한 이유가 있습니까?_compile_select 또는 get_compiled_select()와 같은 함수가 있습니까?

답변

13

DB_active_rec.php에 get_compiled_select()를 추가했는데 문제없이 작동하는 것처럼 보입니다. 그러나 _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; 
} 
관련 문제