Add __call to query builder

This commit is contained in:
Timothy Warren 2012-03-15 13:31:23 -04:00
parent 5e73938733
commit 7275eb10fa
2 changed files with 24 additions and 0 deletions

View File

@ -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
*/

View File

@ -142,6 +142,8 @@ class FirebirdQBTest extends UnitTestCase {
->get();
$this->assertTrue(is_resource($query));
<pre><?= print_r($this->db->fetchAll(), TRUE) ?></pre>
}
/*function TestGroupBy()