CCrmProductPropertyRestProxy::processMethodRequest

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmProductPropertyRestProxy
  4. processMethodRequest
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmProductPropertyRestProxy
  • Вызов: CCrmProductPropertyRestProxy::processMethodRequest
public function processMethodRequest($name, $nameDetails, $arParams, $nav, $server)
{
	$name = mb_strtoupper($name);
	if($name === 'PROPERTY')
	{
		$nameSuffix = mb_strtoupper(!empty($nameDetails)? implode('_', $nameDetails) : '');
		if($nameSuffix === 'FIELDS')
		{
			return self::getFields();
		}
		elseif($nameSuffix === 'TYPES')
		{
			return $this->getTypesInfo();
		}
		else if($nameSuffix === 'SETTINGS_FIELDS')
		{
			$propertyType = $userType = '';
			foreach ($arParams as $name => $value)
			{
				switch(mb_strtolower($name))
				{
					case 'propertytype':
						$propertyType = strval($value);
						break;
					case 'usertype':
						$userType = strval($value);
						break;
				}
			}
			if($propertyType === '')
			{
				throw new RestException("Parameter 'propertyType' is not specified or empty.");
			}
			if($userType === '')
			{
				throw new RestException("Parameter 'userType' is not specified or empty.");
			}

			return $this->getSettingsFieldsInfo($propertyType, $userType);
		}
		else if($nameSuffix === 'ENUMERATION_FIELDS')
		{
			return $this->getEnumerationFieldsInfo();
		}
		else if(in_array($nameSuffix, array('ADD', 'GET', 'LIST', 'UPDATE', 'DELETE'), true))
		{
			return parent::processMethodRequest($nameSuffix, '', $arParams, $nav, $server);
		}
	}

	throw new RestException("Resource '{$name}' is not supported in current context.");
}

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