• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/managers/vendordataexchangemanager.php
  • Класс: BitrixCalendarSyncManagersVendorDataExchangeManager
  • Вызов: VendorDataExchangeManager::exchange
public function exchange(): self
{
	$pushManager = new PushManager();
	$push = $pushManager->getPush(PushManager::TYPE_CONNECTION, $this->factory->getConnection()->getId());
	// TODO: what could to do, if push is blocked ?
	$pushManager->setBlockPush($push);
	try
	{
		$this->exchangeSections();

		$this->sendResult(MasterPushHandler::MASTER_STAGE[1]);

		$this->blockSectionPush($this->syncSectionMap);
		try
		{
			$this->exchangeEvents();
		}
		catch(BaseException $e)
		{}
		finally
		{
			$this->unblockSectionPush($this->syncSectionMap);
		}

		$this->sendResult(MasterPushHandler::MASTER_STAGE[2]);
		$this->sendResult(MasterPushHandler::MASTER_STAGE[3]);

		$this
			->updateConnection($this->factory->getConnection())
			->clearCache() // Clear legacy cache after whole sync
		;
	}
	catch(BaseException $e)
	{
	}
	finally
	{
		$pushManager->setUnblockPush($push);
	}

	return $this;
}