Add serialize callbacks to Horde_Db_Adapter_Base
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 20 May 2010 17:02:21 +0000 (11:02 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 20 May 2010 17:06:41 +0000 (11:06 -0600)
framework/Db/lib/Horde/Db/Adapter/Base.php

index faad463..2247c34 100644 (file)
@@ -133,6 +133,22 @@ abstract class Horde_Db_Adapter_Base
         $this->disconnect();
     }
 
+    /**
+     * Serialize callback.
+     */
+    public function __sleep()
+    {
+        return array_diff(array_keys(get_class_vars(__CLASS__)), array('_active', '_connection'));
+    }
+
+    /**
+     * Unserialize callback.
+     */
+    public function __wakeup()
+    {
+        $this->connect();
+    }
+
 
     /*##########################################################################
     # Object helpers