• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/classes/general/restentity.php
  • Класс: CBitrixRestEntity
  • Вызов: CBitrixRestEntity::entityItemPropertyDelete
static function entityItemPropertyDelete($params, $n, $server)
{
	if(self::checkItemPropertyParams($params))
	{
		if(self::checkEntity($params['ENTITY'], $server))
		{
			$arField = self::getItemProperty($params['PROPERTY'], $params['ENTITY'], $server);
			if($arField)
			{
				if(CIBlockRights::UserHasRightTo($arField['IBLOCK_ID'], $arField['IBLOCK_ID'], 'iblock_edit'))
				{
					$ibp = new CIBlockProperty;
					if(!$ibp->Delete($arField['ID']))
					{
						throw new RestException($ibp->LAST_ERROR, RestException::ERROR_CORE);
					}

					return true;
				}
				else
				{
					throw new AccessException();
				}
			}
			else
			{
				throw new RestException('Property not found', self::ERROR_PROPERTY_NOT_FOUND);
			}
		}
		else
		{
			throw new RestException('Entity not found', self::ERROR_ENTITY_NOT_FOUND);
		}
	}
}