summaryrefslogtreecommitdiff
path: root/framework/Data/SqlMap/Statements/TPreparedStatement.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Data/SqlMap/Statements/TPreparedStatement.php')
-rw-r--r--framework/Data/SqlMap/Statements/TPreparedStatement.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/framework/Data/SqlMap/Statements/TPreparedStatement.php b/framework/Data/SqlMap/Statements/TPreparedStatement.php
index 372c9e88..4bd19c4e 100644
--- a/framework/Data/SqlMap/Statements/TPreparedStatement.php
+++ b/framework/Data/SqlMap/Statements/TPreparedStatement.php
@@ -39,5 +39,19 @@ class TPreparedStatement extends TComponent
public function getParameterValues(){ return $this->_parameterValues; }
public function setParameterValues($value){ $this->_parameterValues = $value; }
+ public function __wakeup()
+ {
+ parent::__wakeup();
+ if (!$this->_parameterNames) $this->_parameterNames = new TList;
+ if (!$this->_parameterValues) $this->_parameterValues = new TMap;
+ }
+
+ public function __sleep()
+ {
+ $exprops = array(); $cn = __CLASS__;
+ if (!$this->_parameterNames->getCount()) $exprops[] = "\0$cn\0_parameterNames";
+ if (!$this->_parameterValues->getCount()) $exprops[] = "\0$cn\0_parameterValues";
+ return array_diff(parent::__sleep(),$exprops);
+ }
}