diff options
Diffstat (limited to 'framework/Data/TDbConnection.php')
-rw-r--r-- | framework/Data/TDbConnection.php | 9 |
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
*/
|