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/TMappedStatement.php | |
parent | 978dc9648c959b77365fed2d954e1bab54aa2e32 (diff) |
further SqlMap optimizations; refs #337
Diffstat (limited to 'framework/Data/SqlMap/Statements/TMappedStatement.php')
-rw-r--r-- | framework/Data/SqlMap/Statements/TMappedStatement.php | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/framework/Data/SqlMap/Statements/TMappedStatement.php b/framework/Data/SqlMap/Statements/TMappedStatement.php index f58a6b39..982a8ce9 100644 --- a/framework/Data/SqlMap/Statements/TMappedStatement.php +++ b/framework/Data/SqlMap/Statements/TMappedStatement.php @@ -41,7 +41,7 @@ class TMappedStatement extends TComponent implements IMappedStatement /**
* @var TPostSelectBinding[] post select statement queue.
*/
- private $_selectQueque=array();
+ private $_selectQueue=array();
/**
* @var boolean true when data is mapped to a particular row.
@@ -506,9 +506,9 @@ class TMappedStatement extends TComponent implements IMappedStatement */
protected function executePostSelect($connection)
{
- while(count($this->_selectQueque))
+ while(count($this->_selectQueue))
{
- $postSelect = array_shift($this->_selectQueque);
+ $postSelect = array_shift($this->_selectQueue);
$method = $postSelect->getMethod();
$statement = $postSelect->getStatement();
$property = $postSelect->getResultProperty()->getProperty();
@@ -869,7 +869,7 @@ class TMappedStatement extends TComponent implements IMappedStatement $postSelect->setMethod(self::QUERY_FOR_OBJECT);
if(!$property->getLazyLoad())
- $this->_selectQueque[] = $postSelect;
+ $this->_selectQueue[] = $postSelect;
}
/**
@@ -918,6 +918,21 @@ class TMappedStatement extends TComponent implements IMappedStatement $this->_IsRowDataFound = $dataFound;
return $dataFound;
}
+
+ public function __wakeup()
+ {
+ parent::__wakeup();
+ if (is_null($this->_selectQueue)) $this->_selectQueue = array();
+ }
+
+ public function __sleep()
+ {
+ $exprops = array(); $cn = __CLASS__;
+ if (!count($this->_selectQueue)) $exprops[] = "\0$cn\0_selectQueue";
+ if (is_null($this->_groupBy)) $exprops[] = "\0$cn\0_groupBy";
+ if (!$this->_IsRowDataFound) $exprops[] = "\0$cn\0_IsRowDataFound";
+ return array_diff(parent::__sleep(),$exprops);
+ }
}
/**
@@ -964,7 +979,7 @@ class TPostSelectBinding * @package System.Data.SqlMap.Statements
* @since 3.1
*/
-class TSqlMapObjectCollectionTree
+class TSqlMapObjectCollectionTree extends TComponent
{
/**
* @var array object graph as tree
@@ -1133,6 +1148,15 @@ class TSqlMapObjectCollectionTree {
return $this->_list;
}
+
+ public function __sleep()
+ {
+ $exprops = array(); $cn = __CLASS__;
+ if (!count($this->_tree)) $exprops[] = "\0$cn\0_tree";
+ if (!count($this->_entries)) $exprops[] = "\0$cn\0_entries";
+ if (!count($this->_list)) $exprops[] = "\0$cn\0_list";
+ return array_diff(parent::__sleep(),$exprops);
+ }
}
/**
|