CCrmDealCategoryProxy::processMethodRequest

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmDealCategoryProxy
  4. processMethodRequest
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmDealCategoryProxy
  • Вызов: CCrmDealCategoryProxy::processMethodRequest
public function processMethodRequest($name, $nameDetails, $arParams, $nav, $server)
{
	$name = mb_strtoupper($name);
	if($name === 'DEFAULT')
	{
		$nameSuffix = mb_strtoupper(!empty($nameDetails)? implode('_', $nameDetails) : '');
		if($nameSuffix === 'GET')
		{
			return array('ID' => 0, 'NAME' => \Bitrix\Crm\Category\DealCategory::getDefaultCategoryName());
		}
		elseif($nameSuffix === 'SET')
		{
			$name = $this->resolveParam($arParams, 'name');
			if(is_string($name))
			{
				\Bitrix\Crm\Category\DealCategory::setDefaultCategoryName($name);
			}
			return true;
		}
	}
	elseif($name === 'STATUS')
	{
		return $this->resolveStatusEntityID(CCrmRestHelper::resolveEntityID($arParams));
	}
	elseif($name === 'STAGE')
	{
		$nameSuffix = mb_strtoupper(!empty($nameDetails)? implode('_', $nameDetails) : '');
		if($nameSuffix === 'LIST')
		{
			$statusProxy = new CCrmStatusRestProxy();
			return $statusProxy->getEntityItems(
				$this->resolveStatusEntityID(CCrmRestHelper::resolveEntityID($arParams))
			);
		}
	}
	return parent::processMethodRequest($name, $nameDetails, $arParams, $nav, $server);
}

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