X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fhub%2Fmain%2Ftemplate%2Fconnect%2Fclass_XmlSelfConnectTemplateEngine.php;h=20d69b3fbadcf8147bf53cee9bb170ddf4493bb1;hb=d9f53fea55379820809e913d2f9c61a2edf36c81;hp=84341daadb58622fa5a92ea62776660cbb8ec502;hpb=e42e5cccbe065c9f54478350c9b96f408c648a9e;p=hub.git diff --git a/application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php b/application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php index 84341daad..20d69b3fb 100644 --- a/application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php +++ b/application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php @@ -23,6 +23,12 @@ * along with this program. If not, see . */ class XmlSelfConnectTemplateEngine extends BaseTemplateEngine implements CompileableTemplate, Registerable { + /** + * Data nodes + */ + const SELF_CONNECT_DATA_NODE_ID = 'node-id'; + const SELF_CONNECT_DATA_SESSION_ID = 'session-id'; + /** * Main nodes in the XML tree */ @@ -33,11 +39,7 @@ class XmlSelfConnectTemplateEngine extends BaseTemplateEngine implements Compile /** * Sub nodes in the XML tree */ - private $subNodes = array( - 'self-connect-data', - 'node-id', - 'session-id' - ); + private $subNodes = array(); /** * Current main node @@ -57,6 +59,13 @@ class XmlSelfConnectTemplateEngine extends BaseTemplateEngine implements Compile protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); + + // Init array + $this->subNodes = array( + 'self-connect-data', + self::SELF_CONNECT_DATA_NODE_ID, + self::SELF_CONNECT_DATA_SESSION_ID + ); } /** @@ -314,7 +323,7 @@ class XmlSelfConnectTemplateEngine extends BaseTemplateEngine implements Compile */ private function startNodeId () { // Push the node name on the stacker - $this->getStackerInstance()->pushNamed('self_connect', 'node-id'); + $this->getStackerInstance()->pushNamed('self_connect', self::SELF_CONNECT_DATA_NODE_ID); } /** @@ -324,7 +333,7 @@ class XmlSelfConnectTemplateEngine extends BaseTemplateEngine implements Compile */ private function startSessionId () { // Push the node name on the stacker - $this->getStackerInstance()->pushNamed('self_connect', 'session-id'); + $this->getStackerInstance()->pushNamed('self_connect', self::SELF_CONNECT_DATA_SESSION_ID); } /**