summaryrefslogtreecommitdiff
path: root/framework/Data/TDbConnection.php
diff options
context:
space:
mode:
authorwei <>2006-12-03 22:26:04 +0000
committerwei <>2006-12-03 22:26:04 +0000
commit503cdec992e78bf4180fa720800b9d3a3bc551e2 (patch)
tree0a53819ddc430e5224583dc9efa403f320eeb814 /framework/Data/TDbConnection.php
parentbf8caefce718cc38ccfd121d9cd718f42021b2b9 (diff)
Allow TDbConnection and TDbCommand to be serialized.
Diffstat (limited to 'framework/Data/TDbConnection.php')
-rw-r--r--framework/Data/TDbConnection.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/framework/Data/TDbConnection.php b/framework/Data/TDbConnection.php
index f0a0bc0d..3a1cc764 100644
--- a/framework/Data/TDbConnection.php
+++ b/framework/Data/TDbConnection.php
@@ -102,6 +102,15 @@ class TDbConnection extends TComponent
}
/**
+ * Close the connection when serializing.
+ */
+ public function __sleep()
+ {
+ $this->close();
+ return array_keys(get_object_vars($this));
+ }
+
+ /**
* @return array list of available PDO drivers
* @see http://www.php.net/manual/en/function.pdo-getavailabledrivers.php
*/