Add __call to query builder
This commit is contained in:
parent
5e73938733
commit
7275eb10fa
@ -920,6 +920,28 @@ class Query_Builder {
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Calls a function further down the inheritence chain
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call($name, $params)
|
||||
{
|
||||
if ( ! empty($this->db->$name))
|
||||
{
|
||||
if (is_callable($this->db->$name))
|
||||
{
|
||||
return call_user_func_array(array($this->db, $name), $params);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Clear out the class variables, so the next query can be run
|
||||
*/
|
||||
|
@ -142,6 +142,8 @@ class FirebirdQBTest extends UnitTestCase {
|
||||
->get();
|
||||
|
||||
$this->assertTrue(is_resource($query));
|
||||
|
||||
<pre><?= print_r($this->db->fetchAll(), TRUE) ?></pre>
|
||||
}
|
||||
|
||||
/*function TestGroupBy()
|
||||
|
Loading…
Reference in New Issue
Block a user