I need to read this function and create an xml with the title, description and etc fields.
then the table.
public function defineCustomTemplate()
{
$this->setNmfile(302444);
$this->setNmoperation("CPTEVALITHAB");
$this->setNmimport(302433);
$customTemplate = array();
$customTemplate[] = array('column' => 'nmfield01', 'term' => 103571, 'dataType' => 2, 'precision' => 50, 'description' => 213795, 'required' => 1);
$customTemplate[] = array('column' => 'nmfield02', 'term' => 102213, 'dataType' => 2, 'precision' => 50, 'description' => 302440, 'required' => 1);
$customTemplate[] = array('column' => 'nmfield03', 'term' => 302442, 'dataType' => 2, 'precision' => 50, 'description' => 302442, 'required' => 1);
$customTemplate[] = array('column' => 'nmfield04', 'term' => 302443, 'dataType' => 2, 'precision' => 50, 'description' => 302443, 'required' => 1);
return $customTemplate;
}
this function appears in several classes of the project and I would like to capture everywhere it is displayed and create the xml.
can someone help me?
2
Answers
You can use the SimpleXMLElement class in PHP to create an XML document with the data from the defineCustomTemplate() function.
approximate solution without fields hardcoding
output template: