Generalized query_builder '_reset' method
This commit is contained in:
parent
4701cbfe65
commit
9d33c5e8f0
@ -464,13 +464,28 @@ class Query_Builder {
|
|||||||
*/
|
*/
|
||||||
private function _reset()
|
private function _reset()
|
||||||
{
|
{
|
||||||
unset($this->table);
|
// Only unset class variables that
|
||||||
unset($this->where_array);
|
// are not callable. Otherwise, we'll
|
||||||
unset($this->where_string);
|
// delete class methods!
|
||||||
unset($this->select_string);
|
foreach($this as $name => $var)
|
||||||
unset($this->from_string);
|
{
|
||||||
unset($this->limit);
|
// Skip properties that are needed for every query
|
||||||
unset($this->offset);
|
$save_properties = array(
|
||||||
|
'db',
|
||||||
|
'sql'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (in_array($name, $save_properties))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Nothing query-generation related is safe!
|
||||||
|
if ( ! is_callable($this->$name))
|
||||||
|
{
|
||||||
|
unset($this->$name);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user