/** * @param mixed $connection * @param string $name */ public static function addDbConnection($connection, $name = "DefaultConnection") { if (is_null(MDbConnection::$instance)) { MDbConnection::$instance = new MDbConnection(); } MDbConnection::$instance->connection[$name] = $connection; }
/** * @param $dbName * @return MDbConnection */ function getDb($dbName) { return MDbConnection::getInstance($this->main[$dbName]); }