11-01-2007, 01:24 PM
|
#7 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,053
Thanks: 115
|
I have another question.
Your static function factory, can I name it something else?
PHP Code:
public static function &getType($szType = '') { if(!is_object(self::$pDB)) { switch($szType) { case 'mysql': self::$pDB = new DBmysql; break; case 'mssql': self::$pDB = new DBmssql; break; default: self::$pDB = new DBmysql; break; } } return self::$pDB; } }
PHP Code:
$db = DB::getType('mysql'); $db->connect()->query('...');
???
|
|
|
|