CCrmInvoiceRestService::prepareSelect

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmInvoiceRestService
  4. prepareSelect
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice_invoice.php
  • Класс: \CCrmInvoiceRestService
  • Вызов: CCrmInvoiceRestService::prepareSelect
static function prepareSelect($arSelect)
{
	$arResult = array();

	if (is_array($arSelect))
	{
		$bAllFields = false;
		if (count($arSelect) === 0 || in_array('*', $arSelect, true))
			$bAllFields = true;

		$fieldsInfo = self::getFieldsInfo();
		foreach ($fieldsInfo as $fieldName => $fieldInfo)
		{
			if (isset($fieldInfo['list']) && $fieldInfo['list'] === true)
			{
				if ($bAllFields || in_array($fieldName, $arSelect, true))
					$arResult[] = $fieldName;
			}
		}
	}

	// user fields
	if(is_array($arSelect))
	{
		$userFields = CCrmInvoice::GetUserFields();

		if(in_array("UF_*", $arSelect))
		{
			foreach($userFields as $fieldName => $arField)
				$arResult[] = $fieldName;
		}
		else
		{
			foreach($arSelect as $fieldName)
			{
				if(array_key_exists($fieldName, $userFields))
					$arResult[] = $fieldName;
			}
		}
	}

	return $arResult;
}

Добавить комментарий