diff options
author | ctrlaltca@gmail.com <> | 2012-02-14 08:13:27 +0000 |
---|---|---|
committer | ctrlaltca@gmail.com <> | 2012-02-14 08:13:27 +0000 |
commit | 1eaa6ca1775d335e2307d958c7f0ad27f7cd6807 (patch) | |
tree | 7a5727afab407a03047ae2435da03beadab7d941 /framework/Data/SqlMap/Statements/TPreparedStatement.php | |
parent | 978dc9648c959b77365fed2d954e1bab54aa2e32 (diff) |
further SqlMap optimizations; refs #337
Diffstat (limited to 'framework/Data/SqlMap/Statements/TPreparedStatement.php')
-rw-r--r-- | framework/Data/SqlMap/Statements/TPreparedStatement.php | 14 |
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);
+ }
}
|