[limb-svn] r7034 - in 3.x/trunk/limb/dbal/src: . drivers

svn at limb-project.com svn at limb-project.com
Thu May 22 07:50:50 MSD 2008


Author: vasiatka
Date: 2008-05-22 07:50:49 +0400 (Thu, 22 May 2008)
New Revision: 7034
URL: http://fisheye.limb-project.com/changelog/limb/?cs=7034

Modified:
   3.x/trunk/limb/dbal/src/drivers/lmbDbBaseConnection.class.php
   3.x/trunk/limb/dbal/src/lmbTableGateway.class.php
Log:
-- add __sleep and __wakeup to lmbTableGateway
-- add __sleep to lmbDbBaseConnection

Modified: 3.x/trunk/limb/dbal/src/drivers/lmbDbBaseConnection.class.php
===================================================================
--- 3.x/trunk/limb/dbal/src/drivers/lmbDbBaseConnection.class.php	2008-05-21 09:25:17 UTC (rev 7033)
+++ 3.x/trunk/limb/dbal/src/drivers/lmbDbBaseConnection.class.php	2008-05-22 03:50:49 UTC (rev 7034)
@@ -2,13 +2,13 @@
 /*
  * Limb PHP Framework
  *
- * @link http://limb-project.com 
+ * @link http://limb-project.com
  * @copyright  Copyright © 2004-2007 BIT(http://bit-creative.com)
- * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
+ * @license    LGPL http://www.gnu.org/copyleft/lesser.html
  */
 
 lmb_require('limb/dbal/src/drivers/lmbDbConnection.interface.php');
- 
+
 /**
  * class lmbBaseDbConnection.
  * A base class for all connection classes
@@ -20,7 +20,7 @@
 {
   protected $config;
   protected $dsn_string;
-  
+
   function __construct($config, $dsn_string = null)
   {
     $this->config = $config;
@@ -29,21 +29,26 @@
     else
       $this->dsn_string = $dsn_string;
   }
-  
+
   function getConfig()
   {
     return $this->config;
   }
-  
+
   function getHash()
   {
     return crc32(serialize($this->config));
   }
-  
+
   function getDsnString()
   {
     return $this->dsn_string;
   }
+
+  function __sleep()
+  {
+    return array('config','dsn_string');
+  }
 }
 
 

Modified: 3.x/trunk/limb/dbal/src/lmbTableGateway.class.php
===================================================================
--- 3.x/trunk/limb/dbal/src/lmbTableGateway.class.php	2008-05-21 09:25:17 UTC (rev 7033)
+++ 3.x/trunk/limb/dbal/src/lmbTableGateway.class.php	2008-05-22 03:50:49 UTC (rev 7034)
@@ -321,6 +321,19 @@
     }
     return $filtered;
   }
+
+  function __wakeup()
+  {
+    $toolkit = lmbToolkit :: instance();
+  }
+
+  function __sleep()
+  {
+    $this->getTableInfo();
+    $vars = array_keys(get_object_vars($this));
+    $vars = array_diff($vars, array('_toolkit'));
+    return $vars;
+  }
 }
 
 



More information about the limb-svn mailing list