• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/exchange/integration/service/batchable/deal.php
  • Класс: BitrixSaleExchangeIntegrationServiceBatchableDeal
  • Вызов: Deal::dealContactUpdates
public function dealContactUpdates($id, $params, $contacts)
{
	$result = [];
	$indexes = self::getIndexesFromParams($params);
	$contacts = static::getIndexesContactFromParams($contacts);

	$relations = static::clientRelation($indexes, BusinessValuePersonDomainType::TYPE_I_NAME);

	$contactIds = [];
	/** @var IntegrationRelationRelation $relation */
	foreach ($relations as $relation)
	{
		$contactIds[] = $relation->getDestinationEntityId();
	}

	if(count(array_diff($contactIds, $contacts))>0)
	{
		$proxy = static::getProxy();
		$r = $proxy->contactItemsSet($id, static::getContactItemsFromIndexes(array_merge($contactIds, $contacts)));
		if($r->isSuccess())
		{
			$result = $r->getData()['DATA']['result'];
		}
		else
		{
			throw new ExceptionBatchableException(implode(',', $r->getErrorMessages()));
		}
	}
	return $result;
}