From dd2c62202d2ddf38c606097e5f98ffc080885c4a Mon Sep 17 00:00:00 2001 From: secretr Date: Sun, 2 May 2010 12:46:59 +0000 Subject: [PATCH] onLoad trigger for model tree base class --- e107_handlers/model_class.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/e107_handlers/model_class.php b/e107_handlers/model_class.php index f67a32ae3..5e1210f94 100644 --- a/e107_handlers/model_class.php +++ b/e107_handlers/model_class.php @@ -2231,6 +2231,17 @@ class e_tree_model extends e_model } $this->setTree($tree, true); } + + /** + * Additional on load logic to be set from subclasses + * + * @param e_model $node + * @return e_tree_model + */ + protected function _onLoad($node) + { + return $this; + } /** * Default load method @@ -2282,7 +2293,7 @@ class e_tree_model extends e_model { $tmp->setMessageStackName($this->getParam('model_message_stack')); } - $this->setNode($tmp->get($this->getFieldIdName()), $tmp); + $this->_onLoad($tmp)->setNode($tmp->get($this->getFieldIdName()), $tmp); } if(false === $this->_total && $this->getModelTable() && !$this->getParam('nocount'))