• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/order/tradingplatform/telegram/eventhandler.php
  • Класс: Bitrix\Crm\Order\TradingPlatform\Telegram\EventHandler
  • Вызов: EventHandler::setContact
static function setContact(Crm\Order\Order $order, int $contactId): void
{
	$contactCompanyCollection = $order->getContactCompanyCollection();
	if (!$contactCompanyCollection->isEmpty())
	{
		return;
	}

	$contactCompanyCollection = $order->getContactCompanyCollection();
	/** @var Crm\Order\Contact $contact */
	$contact = $contactCompanyCollection->createContact();
	$contact->setField('ENTITY_ID', $contactId);
	$contact->setField('IS_PRIMARY', 'Y');
}