From 503cdec992e78bf4180fa720800b9d3a3bc551e2 Mon Sep 17 00:00:00 2001 From: wei <> Date: Sun, 3 Dec 2006 22:26:04 +0000 Subject: Allow TDbConnection and TDbCommand to be serialized. --- framework/Data/TDbCommand.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'framework/Data/TDbCommand.php') diff --git a/framework/Data/TDbCommand.php b/framework/Data/TDbCommand.php index 98bb31ea..a84ef39c 100644 --- a/framework/Data/TDbCommand.php +++ b/framework/Data/TDbCommand.php @@ -53,6 +53,15 @@ class TDbCommand extends TComponent $this->setText($text); } + /** + * Set the statement to null when serializing. + */ + public function __sleep() + { + $this->_statement=null; + return array_keys(get_object_vars($this)); + } + /** * @return string the SQL statement to be executed */ @@ -193,6 +202,7 @@ class TDbCommand extends TComponent */ public function query() { +// Prado::debug(); try { if($this->_statement instanceof PDOStatement) -- cgit v1.2.3