• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/exchange/onec/documentbase.php
  • Класс: BitrixSaleExchangeOneCDocumentBase
  • Вызов: DocumentBase::outputXmlStories
protected function outputXmlStories($level, $name, $stories)
{
	$result ='';
	$result .= $this->openNodeDirectory($level+0, $name);

	foreach ($stories as $store)
	{
		$result .= $this->openNodeDirectory($level+1, 'STORY');
		foreach ($store as $code=>$value)
		{
			if(is_array($value))
			{
				switch ($code)
				{
					case 'ADDRESS':
					case 'CONTACTS':
						$result .= $this->openNodeDirectory($level+2, $code);
						$result .= $this->outputXmlAddress($level+3, $value);
						$result .= $this->closeNodeDirectory($level+2, $code);
						break;
				}
			}
			else
				$result .= $this->formatXMLNode($level+2, $code, $value);
		}
		$result .= $this->closeNodeDirectory($level+1, 'STORY');
	}
	$result .= $this->closeNodeDirectory($level+0, $name);

	return $result;
}