CCrmCurrencyRestProxy::processMethodRequest

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmCurrencyRestProxy
  4. processMethodRequest
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmCurrencyRestProxy
  • Вызов: CCrmCurrencyRestProxy::processMethodRequest
public function processMethodRequest($name, $nameDetails, $arParams, $nav, $server)
{
	$name = mb_strtoupper($name);
	if($name === 'LOCALIZATIONS')
	{
		$nameSuffix = mb_strtoupper(!empty($nameDetails)? implode('_', $nameDetails) : '');
		if($nameSuffix === 'FIELDS')
		{
			$fildsInfo = $this->getLocalizationFieldsInfo();
			return parent::prepareFields($fildsInfo);
		}
		elseif($nameSuffix === 'GET')
		{
			return $this->getLocalizations($this->resolveEntityID($arParams));
		}
		elseif($nameSuffix === 'SET')
		{
			$ID = $this->resolveEntityID($arParams);
			$localizations = $this->resolveArrayParam($arParams, 'localizations');
			return $this->setLocalizations($ID, $localizations);
		}
		elseif($nameSuffix === 'DELETE')
		{
			$ID = $this->resolveEntityID($arParams);
			$lids = $this->resolveArrayParam($arParams, 'lids');
			return $this->deleteLocalizations($ID, $lids);
		}
	}
	elseif($name === 'BASE')
	{
		$nameSuffix = mb_strtoupper(!empty($nameDetails)? implode('_', $nameDetails) : '');
		if($nameSuffix === 'GET')
		{
			return \CCrmCurrency::GetBaseCurrencyID();
		}
		elseif($nameSuffix === 'SET')
		{
			$ID = $this->resolveEntityID($arParams);
			if(!CCrmCurrency::CheckUpdatePermission($ID))
			{
				throw new RestException('Access denied.');
			}
			return \CCrmCurrency::SetBaseCurrencyID($ID);
		}
	}
	return parent::processMethodRequest($name, $nameDetails, $arParams, $nav, $server);
}

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