04-06-2009, 09:11 PM
|
#1 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
__call
Hi!
I'm intrigued(spelling?) how this really works.
I have it set up like this:
In my DB object
PHP Code:
public function __call($function, $params) { if(is_object($this->DB_Helper)) { return $this->DB_Helper->$function($params[0]); } TANAXIA_CORE::error('DB_Helper is not loaded. Check out database config file.'); return false; }
And then my DB_helper objects' functions looks like this(for example):
PHP Code:
public function order_by($order, $how) { $this->order_by[$order] = $how; return $this; }
But if I call it like $db->order_by('test_cat', 'DESC')
that gets on ONE line, so when it calls the function the function will be:
$this->DB_Helper->order_by('test_cat, DESC');
Leaving the second option out.. how can I get it to actually set the two parameters(or even more parameters) ??
__________________
|
|
|
|