• Модуль: webservice
  • Путь к файлу: ~/bitrix/modules/webservice/classes/general/sharepoint/client.php
  • Класс: CSPListsClient
  • Вызов: CSPListsClient::GetList
public function GetList($listName)
{
	if (
		$this->__initialize()
		&& $this->Call('GetList', array('listName' => $listName))
		&& ($DOM = $this->RESPONSE->DOMDocument)
	)
	{
		$RESULT = array('PARAMS' => array(), 'FIELDS' => array());

		$LIST = $DOM->elementsByName('List');
		$LIST = $LIST[0];

		$ar = $LIST->getAttributes();
		foreach ($ar as $attr)
		{
			$RESULT['PARAMS'][$attr->name()] = $attr->textContent();
		}

		$arFieldNodes = $LIST->elementsByName('Field');

		if (is_array($arFieldNodes) && count($arFieldNodes) > 0)
		{
			foreach ($arFieldNodes as $node)
			{
				$ar = $node->getAttributes();
				$arField = array();
				foreach ($ar as $attr)
				{
					$arField[$attr->name()] = $attr->textContent();
				}

				if ($arField['ID'])
				{
					if ($arField['Type'] == 'Choice' || $arField['Type'] == 'MultiChoice')
					{
						$arChoiceNodes = $node->elementsByName('CHOICE');
						$arField['CHOICE'] = array();
						foreach ($arChoiceNodes as $choice_node)
						{
							$arField['CHOICE'][] = $choice_node->textContent();
						}

						$arDefaultNodes = $arChoiceNodes = $node->elementsByName('Default');
						if (count($arDefaultNodes) > 0)
							$arField['DEFAULT'] = $arDefaultNodes[0]->textContent();
					}

					$RESULT['FIELDS'][] = $arField;
				}
			}
		}

		return $this->GetListProcessResult($RESULT);
	}

	return false;
}