From 1eaa6ca1775d335e2307d958c7f0ad27f7cd6807 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Tue, 14 Feb 2012 08:13:27 +0000 Subject: further SqlMap optimizations; refs #337 --- framework/Data/SqlMap/Statements/TPreparedStatement.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'framework/Data/SqlMap/Statements/TPreparedStatement.php') 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); + } } -- cgit v1.2.3