From 562e322fe595b4d3307ff28a96c8c5fbcc284010 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Thu, 25 Feb 2016 17:01:17 +0100 Subject: Applied some misc optimizations to class serialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid saving in the page state the values of class variables if they’re still the default. Reduces page state size, based on the work initiated in 8dc9d4f7d49bcbeaf4998baf74a4f4459967c1f0 --- .../Web/UI/WebControls/TDataGridPagerStyle.php | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'framework/Web/UI/WebControls/TDataGridPagerStyle.php') diff --git a/framework/Web/UI/WebControls/TDataGridPagerStyle.php b/framework/Web/UI/WebControls/TDataGridPagerStyle.php index b96d0cd2..36d55ba9 100644 --- a/framework/Web/UI/WebControls/TDataGridPagerStyle.php +++ b/framework/Web/UI/WebControls/TDataGridPagerStyle.php @@ -32,6 +32,35 @@ class TDataGridPagerStyle extends TPanelStyle private $_visible=null; private $_buttonType=null; + /** + * Returns an array with the names of all variables of this object that should NOT be serialized + * because their value is the default one or useless to be cached for the next page loads. + * Reimplement in derived classes to add new variables, but remember to also to call the parent + * implementation first. + */ + protected function __getZappableSleepProps(&$exprops) + { + parent::__getZappableSleepProps($exprops); + if ($this->_mode===null) + $exprops[] = "\0TDataGridPagerStyle\0_mode"; + if ($this->_nextText===null) + $exprops[] = "\0TDataGridPagerStyle\0_nextText"; + if ($this->_prevText===null) + $exprops[] = "\0TDataGridPagerStyle\0_prevText"; + if ($this->_firstText===null) + $exprops[] = "\0TDataGridPagerStyle\0_firstText"; + if ($this->_lastText===null) + $exprops[] = "\0TDataGridPagerStyle\0_lastText"; + if ($this->_buttonCount===null) + $exprops[] = "\0TDataGridPagerStyle\0_buttonCount"; + if ($this->_position===null) + $exprops[] = "\0TDataGridPagerStyle\0_position"; + if ($this->_visible===null) + $exprops[] = "\0TDataGridPagerStyle\0_visible"; + if ($this->_buttonType===null) + $exprops[] = "\0TDataGridPagerStyle\0_buttonType"; + } + /** * @return TDataGridPagerMode pager mode. Defaults to TDataGridPagerMode::NextPrev. */ -- cgit v1.2.3