diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2016-02-25 17:01:17 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2016-02-25 17:01:17 +0100 |
commit | 562e322fe595b4d3307ff28a96c8c5fbcc284010 (patch) | |
tree | 4b16f146c8ee931dc084758798cfdb32f64b914b /framework/Web/UI/WebControls/TPanelStyle.php | |
parent | 294682fb45014ba04ce1b193af712208b15a6151 (diff) |
Applied some misc optimizations to class serialization
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
Diffstat (limited to 'framework/Web/UI/WebControls/TPanelStyle.php')
-rw-r--r-- | framework/Web/UI/WebControls/TPanelStyle.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/framework/Web/UI/WebControls/TPanelStyle.php b/framework/Web/UI/WebControls/TPanelStyle.php index 2e0f1a2a..a3558dc7 100644 --- a/framework/Web/UI/WebControls/TPanelStyle.php +++ b/framework/Web/UI/WebControls/TPanelStyle.php @@ -46,6 +46,27 @@ class TPanelStyle extends TStyle private $_wrap=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->_backImageUrl===null) + $exprops[] = "\0TPanelStyle\0_backImageUrl"; + if ($this->_direction===null) + $exprops[] = "\0TPanelStyle\0_direction"; + if ($this->_horizontalAlign===null) + $exprops[] = "\0TPanelStyle\0_horizontalAlign"; + if ($this->_scrollBars===null) + $exprops[] = "\0TPanelStyle\0_scrollBars"; + if ($this->_wrap===null) + $exprops[] = "\0TPanelStyle\0_wrap"; + } + + /** * Adds attributes related to CSS styles to renderer. * This method overrides the parent implementation. * @param THtmlWriter the writer used for the rendering purpose |