CCrmEntityBindingProxy::processMethodRequest

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmEntityBindingProxy
  4. processMethodRequest
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmEntityBindingProxy
  • Вызов: CCrmEntityBindingProxy::processMethodRequest
public function processMethodRequest($name, $nameDetails, $arParams, $nav, $server)
{
	$name = mb_strtoupper($name);
	if($name === 'FIELDS')
	{
		return $this->getFields();
	}
	elseif($name === 'ADD')
	{
		return $this->addItem(
			CCrmRestHelper::resolveEntityID($arParams),
			CCrmRestHelper::resolveArrayParam($arParams, 'fields')
		);
	}
	elseif($name === 'DELETE')
	{
		return $this->deleteItem(
			CCrmRestHelper::resolveEntityID($arParams),
			CCrmRestHelper::resolveArrayParam($arParams, 'fields')
		);
	}
	elseif($name === 'ITEMS')
	{
		$nameSuffix = mb_strtoupper(!empty($nameDetails)? implode('_', $nameDetails) : '');
		if($nameSuffix === 'GET')
		{
			return $this->getItems(CCrmRestHelper::resolveEntityID($arParams));
		}
		elseif($nameSuffix === 'SET')
		{
			return $this->setItems(
				CCrmRestHelper::resolveEntityID($arParams),
				CCrmRestHelper::resolveArrayParam($arParams, 'items')
			);
		}
		elseif($nameSuffix === 'DELETE')
		{
			return $this->deleteItems(CCrmRestHelper::resolveEntityID($arParams));
		}
	}
	throw new RestException('Method not found!', RestException::ERROR_METHOD_NOT_FOUND, CRestServer::STATUS_NOT_FOUND);
}

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