• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/google/sectionmanager.php
  • Класс: BitrixCalendarSyncGoogleSectionManager
  • Вызов: SectionManager::prepareResult
private function prepareResult(string $result, CoreSectionSection $section): array
{
	$externalSection = Json::decode($result);

	$sectionConnection = (new SyncGoogleBuildersBuilderSectionConnectionFromExternalSection(
		$externalSection,
		$section,
		$this->connection)
	)->build();

	$syncSection = (new SyncEntitiesSyncSection())
		->setSection($section)
		->setVendorName(CoreSectionSection::LOCAL_EXTERNAL_TYPE)
		->setAction(SyncDictionary::SYNC_EVENT_ACTION['success'])
		->setSectionConnection($sectionConnection)
	;

	// TODO: get rid of array structure. It's better to replace with SyncSection object
	return [
		'id' => $externalSection['id'],
		'version' => $externalSection['etag'],
		'syncSection' => $syncSection,
	];
}