summaryrefslogtreecommitdiff
path: root/libs/sysplugins/smarty_internal_data.php
diff options
context:
space:
mode:
authoruwetews <uwe.tews@googlemail.com>2016-09-11 04:35:52 +0200
committeruwetews <uwe.tews@googlemail.com>2016-09-11 04:35:52 +0200
commit0a8e47ecb2431913afb1eab4666fbf60bfa3efe4 (patch)
treef1be0bd820adb2e060bb853f8350ecbcb8aa8d88 /libs/sysplugins/smarty_internal_data.php
parente62b40c4210905502af252cf2b8d6a3ab18b67e4 (diff)
downloadsmarty-0a8e47ecb2431913afb1eab4666fbf60bfa3efe4.tar.gz
smarty-0a8e47ecb2431913afb1eab4666fbf60bfa3efe4.tar.bz2
smarty-0a8e47ecb2431913afb1eab4666fbf60bfa3efe4.zip
- improvement move often used code snippets into methods
Diffstat (limited to 'libs/sysplugins/smarty_internal_data.php')
-rw-r--r--libs/sysplugins/smarty_internal_data.php45
1 files changed, 43 insertions, 2 deletions
diff --git a/libs/sysplugins/smarty_internal_data.php b/libs/sysplugins/smarty_internal_data.php
index 62366085..fd9c3020 100644
--- a/libs/sysplugins/smarty_internal_data.php
+++ b/libs/sysplugins/smarty_internal_data.php
@@ -14,7 +14,8 @@
* @package Smarty
* @subpackage Template
*
- * @property int $scope
+ * @property int $scope
+ * @property Smarty $smarty
* The following methods will be dynamically loaded by the extension handler when they are called.
* They are located in a corresponding Smarty_Internal_Method_xxxx class
*
@@ -100,7 +101,7 @@ class Smarty_Internal_Data
}
} else {
if ($tpl_var != '') {
- if ($this->_objType == 2) {
+ if ($this->_objType === 2) {
/** @var Smarty_Internal_Template $this */
$this->_assignInScope($tpl_var, $value, $nocache);
} else {
@@ -229,6 +230,46 @@ class Smarty_Internal_Data
}
/**
+ * Return true if this instance is a Data obj
+ *
+ * @return bool
+ */
+ public function _isDataObj()
+ {
+ return $this->_objType === 4;
+ }
+
+ /**
+ * Return true if this instance is a template obj
+ *
+ * @return bool
+ */
+ public function _isTplObj()
+ {
+ return $this->_objType === 2;
+ }
+
+ /**
+ * Return true if this instance is a Smarty obj
+ *
+ * @return bool
+ */
+ public function _isSmartyObj()
+ {
+ return $this->_objType === 1;
+ }
+
+ /**
+ * Get Smarty object
+ *
+ * @return Smarty
+ */
+ public function _getSmartyObj()
+ {
+ return $this->smarty;
+ }
+
+ /**
* Handle unknown class methods
*
* @param string $name unknown method-name