Source for file SimpleBuilder.class.php
Documentation is available at SimpleBuilder.class.php
* @copyright Energine 2006
//require_once('core/framework/Builder.class.php');
* Построитель XML-документа.
* @param string recordset title
protected function run() {
$dom_recordSet = $this->result->createElement('recordset');
$this->result->appendChild($dom_recordSet);
if ($this->data->isEmpty() || !$this->data->getRowCount()) {
$dom_recordSet->setAttribute('empty', 'empty');
if (!$this->data->isEmpty()) {
$rowCount = $this->data->getRowCount();
$dom_record = $this->result->createElement('record');
foreach ($this->dataDescription->getFieldDescriptions() as $fieldName => $fieldInfo) {
$fieldProperties = false;
if ($fieldInfo->getPropertyValue('tabName') === null) {
$fieldInfo->setProperty('tabName', $this->title);
// если тип поля предполагает выбор из нескольких значений - создаем соответствующие узлы
if ($this->data && $this->data->getFieldByName($fieldName)) {
$data = array($this->data->getFieldByName($fieldName)->getRowData($i));
$data = $this->data->getFieldByName($fieldName)->getRowData($i);
elseif ($this->data->isEmpty()) {
elseif ($this->data->getFieldByName($fieldName)) {
$fieldProperties = $this->data->getFieldByName($fieldName)->getRowProperties($i);
$fieldValue = $this->data->getFieldByName($fieldName)->getRowData($i);
$dom_field = $this->createField($fieldName, $fieldInfo, $fieldValue, $fieldProperties);
$dom_record->appendChild($dom_field);
$dom_recordSet->appendChild($dom_record);
|