• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/update_class.php
  • Класс: CUpdatesXML
  • Вызов: CUpdatesXML::__toArray
function __toArray()
{
	$arInd = array();
	$retHash = array();

	$retHash["@"] = array();
	if (!empty($this->attributes) && is_array($this->attributes))
		foreach ($this->attributes as $attr)
		{
			$retHash["@"][$attr->name] = $attr->content;
		}

	$retHash["#"] = "";
	if ($this->content <> '')
	{
		$retHash["#"] = $this->content;
	}
	else
	{
		if (!empty($this->children) && is_array($this->children))
		{
			$ar = array();
			foreach ($this->children as $child)
			{
				if (array_key_exists($child->name, $arInd))
					$arInd[$child->name] = $arInd[$child->name] + 1;
				else
					$arInd[$child->name] = 0;

				$ar[$child->name][$arInd[$child->name]] = $child->__toArray();
			}
			$retHash["#"] = $ar;
		}
	}

	return $retHash;
}