summaryrefslogtreecommitdiff
path: root/libs/sysplugins/smarty_internal_data.php
diff options
context:
space:
mode:
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