• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/google/eventmanager.php
  • Класс: BitrixCalendarSyncGoogleEventManager
  • Вызов: EventManager::prepareContextForInstance
public function prepareContextForInstance(Event $event, EventContext $context): ?EventContext
{
	if (
		($context->getEventConnection() === null)
		|| ($context->getSectionConnection() === null)
	)
	{
		return null;
	}

	$masterVendorEventId = $context->getEventConnection()->getVendorEventId();

	if ($context->getEventConnection()->getEvent()->getVersion() > $event->getVersion())
	{
		$event->setVersion($context->getEventConnection()->getEvent()->getVersion());
	}

	return (new EventContext())
		->setSectionConnection($context->getSectionConnection())
		->setEventConnection(
			(new EventConnection())
				->setVendorEventId(
					$this->getInstanceId($masterVendorEventId, $event)
				)
				->setRecurrenceId($masterVendorEventId)
		);
}