• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/managers/servicesynchronization.php
  • Класс: BitrixCalendarSyncManagersServiceSynchronization
  • Вызов: ServiceSynchronization::prepareEventContextFromContext
private function prepareEventContextFromContext(Context $context, Section $eventSection, Event $event = null): EventContext
{
	$eventContext = new EventContext();
	/** @var SectionConnectionMap $sectionConnectionMap */
	$sectionConnectionMap = $context->sectionConnections;
	$sectionConnection = $sectionConnectionMap->getItem($eventSection->getId());

	if ($event)
	{
		if (isset($context->eventConnections))
		{
			$eventContext->setEventConnection($context->eventConnections->getItem($event->getId()));
		}

		if ($location = $event->getLocation())
		{
			$eventContext->location = Util::getTextLocation((string)$location);
		}
	}

	$eventContext->setSectionConnection($sectionConnection);

	return $eventContext;
}