• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/exchange/integration/service/batchable/deal.php
  • Класс: BitrixSaleExchangeIntegrationServiceBatchableDeal
  • Вызов: Deal::init
public function init($params)
{
	foreach($params as $index=>$item)
	{
		$entity = IntegrationServiceInternalEntityFactory::create($this->getDstEntityTypeId());

		$entity->setTitle($item['TITLE']);
		$entity->setOriginId($index);
		$entity->setOriginatorId(static::ANALITICS_ORIGINATOR_ID);
		$entity->setOpportunity($item['PRICE']);
		$entity->setCurrency($item['CURRENCY']);

		if($item['COMPANY_ID'])
		{
			$entity->setCompanyId($item['COMPANY_ID']);
		}
		if($item['CONTACT_ID'])
		{
			$entity->setContactId($item['CONTACT_ID'])	;
		}

		$this->collection->addItem(
			IntegrationServiceInternalContainerItem::create($entity)
				->setInternalIndex($index)
		);
	}
	return $this;
}