• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/exchange/integration/service/scenarios/base.php
  • Класс: BitrixSaleExchangeIntegrationServiceScenariosBase
  • Вызов: Base::dealAddsRelation
public function dealAddsRelation(array $params)
{
	$deal = new BatchableDeal();

	foreach ($params as $index=>$param)
	{
		if(CRMEntityType::isDefined($param['OWNER_TYPE_ID']))
		{
			if($param['OWNER_TYPE_ID'] == $deal->getDstEntityTypeId())
			{
				static::addRelation(
					$deal->getSrcEntityTypeId(), $index,
					$deal->getDstEntityTypeId(), $param['OWNER_ID']);
			}
			else
			{
				throw new ExceptionScenariosException('OwnerTypeId is not Deal');
			}
		}
		else
		{
			throw new ExceptionScenariosException('OwnerTypeId UNDEFINED');
		}
	}
}