CCrmRestHelper::resolveArrayParam

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

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

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

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

	// Check for hungary notation (arFilter, arSort, arSelect, etc)
	$hungary = "ar{$capitalized}";
	if(isset($arParams[$hungary]))
	{
		return $arParams[$hungary];
	}

	return $default;
}

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