Split _compile method in query_builder class

This commit is contained in:
Timothy Warren 2014-03-20 11:57:50 -04:00
parent f1c19acd86
commit 56c061a7d1

View File

@ -95,7 +95,7 @@ class Query_Builder implements iQuery_Builder {
// Whether to do only an explain on the query // Whether to do only an explain on the query
protected $explain = FALSE; protected $explain = FALSE;
// Subclass instances // Subclass instances
public $db; public $db;
protected $parser; protected $parser;
@ -1339,13 +1339,13 @@ class Query_Builder implements iQuery_Builder {
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
/** /**
* String together the sql statements for sending to the db * Sub-method for generating sql strings
* *
* @param string $type * @param string $type
* @param string $table * @param string $table
* @return $string * @return $string
*/ */
protected function _compile($type='', $table='') protected function _compile_type($type='', $table='')
{ {
$table = $this->db->quote_table($table); $table = $this->db->quote_table($table);
@ -1380,6 +1380,23 @@ class Query_Builder implements iQuery_Builder {
break; break;
} }
return $sql;
}
// --------------------------------------------------------------------------
/**
* String together the sql statements for sending to the db
*
* @param string $type
* @param string $table
* @return $string
*/
protected function _compile($type='', $table='')
{
// Get the base clause for the query
$sql = $this->_compile_type($type, $table);
// Set the where clause // Set the where clause
if ( ! empty($this->query_map)) if ( ! empty($this->query_map))
{ {