CCrmUserFieldRestProxy::processMethodRequest

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmUserFieldRestProxy
  4. processMethodRequest
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmUserFieldRestProxy
  • Вызов: CCrmUserFieldRestProxy::processMethodRequest
public function processMethodRequest($name, $nameDetails, $arParams, $nav, $server)
{
	$name = mb_strtoupper($name);
	if($name === 'FIELDS')
	{
		return self::getFields();
	}
	elseif($name === 'TYPES' && method_exists('\Bitrix\Rest\UserFieldProxy', 'getTypes'))
	{
		return self::getTypes(self::getServer());
	}
	elseif($name === 'SETTINGS')
	{
		$nameSuffix = mb_strtoupper(!empty($nameDetails)? implode('_', $nameDetails) : '');
		if($nameSuffix === 'FIELDS')
		{
			$type = CCrmRestHelper::resolveParam($arParams, 'type', '');
			if($type === '')
			{
				throw new RestException("Parameter 'type' is not specified or empty.");
			}

			return self::getSettingsFields($type);
		}
	}
	elseif($name === 'ENUMERATION')
	{
		$nameSuffix = mb_strtoupper(!empty($nameDetails)? implode('_', $nameDetails) : '');
		if($nameSuffix === 'FIELDS')
		{
			return self::getEnumerationElementFields();
		}
	}
	throw new RestException("Resource '{$name}' is not supported in current context.");
}

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