CCrmRestHelper::resolveParam

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmRestHelper
  4. resolveParam
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmRestHelper
  • Вызов: CCrmRestHelper::resolveParam
static function resolveParam(array &$arParams, $name, $default = null)
{
	if(!is_string($name))
	{
		$name = (string)$name;
	}

	if($name === '')
	{
		return $default;
	}

	if(isset($arParams[$name]))
	{
		return $arParams[$name];
	}

	// Check for lower case notation (type, etc)
	$lower = mb_strtolower($name);
	if(isset($arParams[$lower]))
	{
		return $arParams[$lower];
	}

	// Check for upper case notation (TYPE, etc)
	$upper = mb_strtoupper($name);
	if(isset($arParams[$upper]))
	{
		return $arParams[$upper];
	}

	// Check for capitalized notation (Type, etc)
	$capitalized = ucfirst($lower);
	if(isset($arParams[$capitalized]))
	{
		return $arParams[$capitalized];
	}

	return $default;
}

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