Files
crm.e5.pl/modules/EcmReports/optima/OptimaXML.php
2024-04-27 09:23:34 +02:00

44 lines
892 B
PHP

<?php
require_once 'modules/EcmReports/optima/OptimaXMLConstant.php';
class OptimaXML{
private $sugarSmarty;
public $basicXML;
private $content;
private $dom;
public function __construct(){
$this->sugarSmarty= new Sugar_Smarty();
$this->dom= new DOMDocument;
}
public function generateStartXMl(){
$this->sugarSmarty->assign("WERSJA",OptimaXMLConstant::WERSJA);
$this->sugarSmarty->assign("BAZA_ZRD_ID",OptimaXMLConstant::BAZA_ZRD_ID);
$this->sugarSmarty->assign("BAZA_DOC_ID",OptimaXMLConstant::BAZA_DOC_ID);
$this->content=$this->sugarSmarty->fetch(OptimaXMLConstant::FILE_PATH);
return $this;
}
public function loadXml(){
$this->dom->loadXML($this->content);
$this->basicXML=simplexml_import_dom($this->dom);
return $this;
}
public function getXmlNode(){
return $this->basicXML;
}
}