Make Query Builder more flexible
This commit is contained in:
parent
225a5560fd
commit
961cbbe67a
@ -62,6 +62,19 @@ class Query_Builder {
|
||||
*/
|
||||
public function __construct($params)
|
||||
{
|
||||
// Convert array to object
|
||||
if (is_array($params))
|
||||
{
|
||||
$p = new StdClass();
|
||||
|
||||
foreach($params as $key => $val)
|
||||
{
|
||||
$p->$key = $val;
|
||||
}
|
||||
|
||||
$params = $p;
|
||||
}
|
||||
|
||||
$params->type = strtolower($params->type);
|
||||
$dbtype = ($params->type !== 'postgresql') ? $params->type : 'pgsql';
|
||||
|
||||
|
Reference in New Issue
Block a user