Code improvements

This commit is contained in:
Timothy Warren 2014-04-02 15:11:46 -04:00
parent 9c55ed51c0
commit 5bc366c977
2 changed files with 16 additions and 18 deletions

View File

@ -1242,7 +1242,8 @@ class Query_Builder implements Query_Builder_Interface {
*/ */
public function reset_query() public function reset_query()
{ {
$null_properties = array( // Reset strings and booleans
foreach(array(
'select_string', 'select_string',
'from_string', 'from_string',
'set_string', 'set_string',
@ -1251,9 +1252,13 @@ class Query_Builder implements Query_Builder_Interface {
'limit', 'limit',
'offset', 'offset',
'explain' 'explain'
); ) as $var)
{
$this->$var = NULL;
}
$array_properties = array( // Reset arrays
foreach(array(
'set_array_keys', 'set_array_keys',
'order_array', 'order_array',
'group_array', 'group_array',
@ -1261,16 +1266,7 @@ class Query_Builder implements Query_Builder_Interface {
'where_values', 'where_values',
'query_map', 'query_map',
'having_map' 'having_map'
); ) as $var)
// Reset strings and booleans
foreach($null_properties as $var)
{
$this->$var = NULL;
}
// Reset arrays
foreach($array_properties as $var)
{ {
$this->$var = array(); $this->$var = array();
} }

View File

@ -77,11 +77,13 @@ class Firebird extends Abstract_Driver {
// of DB_PDO, which defines these two // of DB_PDO, which defines these two
// class variables for the other drivers // class variables for the other drivers
foreach(array('sql', 'util') as $sub) // Load the sql class
{ $class = __CLASS__."_sql";
$class = __CLASS__ . "_{$sub}"; $this->sql = new $class();
$this->$sub = new $class($this);
} // Load the util class
$class = __CLASS__."_util";
$this->util = new $class($this);
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------