• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/managers/vendordataexchangemanager.php
  • Класс: BitrixCalendarSyncManagersVendorDataExchangeManager
  • Вызов: VendorDataExchangeManager::handleExportedInstances
private function handleExportedInstances(SyncEntitiesSyncEvent $syncEvent): void
{
	/** @var SyncEntitiesSyncEvent $instance */
	foreach ($syncEvent->getInstanceMap() as $instance)
	{
		if ($instance->getAction() !== SyncDictionary::SYNC_EVENT_ACTION['success'])
		{
			$this->handleExportedFailedSyncEvent($syncEvent);
			continue;
		}

		if ($instanceEventConnection = $instance->getEventConnection())
		{
			$instanceEventConnection
				->setEvent($instance->getEvent())
				->setConnection($syncEvent->getEventConnection()->getConnection())
			;

			if ($instanceEventConnection->getId())
			{
				$this->eventConnectionMapper->update($instanceEventConnection);
			}
			else
			{
				$this->eventConnectionMapper->create($instanceEventConnection);
			}
		}
	}
}