summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
authorMichel Kollenhoven <[email protected]>2013-12-26 16:14:24 +0000
committerSimon Holywell <[email protected]>2013-12-26 16:14:24 +0000
commit7346022dcfadf628e8e3e89e31739ddcc02ead05 (patch)
treeb7b2ddb745fb5e04bf7dcdf29d5afc70dec04dcf /idiorm.php
parent0140d2753a7973d880b6684eaa6cf4922d74b300 (diff)
Allow unsetting the db (ORM::set_db(null)) to make the test work again
Diffstat (limited to 'idiorm.php')
-rw-r--r--idiorm.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/idiorm.php b/idiorm.php
index 7ac1652..143ecb7 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -279,8 +279,10 @@
public static function set_db($db, $connection_name = self::DEFAULT_CONNECTION) {
self::_setup_db_config($connection_name);
self::$_db[$connection_name] = $db;
- self::_setup_identifier_quote_character($connection_name);
- self::_setup_limit_clause_style($connection_name);
+ if(!is_null(self::$_db[$connection_name])) {
+ self::_setup_identifier_quote_character($connection_name);
+ self::_setup_limit_clause_style($connection_name);
+ }
}
/**