2012-02-10 10 views
10

ऐसा लगता है कि _compile_select को बहिष्कृत किया गया है और get_compiled_select 2.1.0 में जोड़ा नहीं गया है। क्या उन दोनों की तरह कोई अन्य काम है? और मैं भी उत्सुक हूँ। सक्रिय रिकॉर्ड में get_compiled_select() जोड़ने और _compile_select को हटाने का कोई विशेष कारण नहीं है?क्या कोई कार्य है जैसे _compile_select या get_compiled_select()?

उत्तर

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; 
} 
संबंधित मुद्दे