• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/managers/outgoingmanager.php
  • Класс: BitrixCalendarSyncManagersOutgoingManager
  • Вызов: OutgoingManager::exportSection
public function exportSection(CoreSectionSection $section): Result
{
	$sectionContext = new SectionContext();
	if ($link = $this->getSectionLink($section))
	{
		if ($link->isActive())
		{
			$result = $this->syncManager->updateSection($section, $sectionContext);
			if ($result->isSuccess())
			{
				$result->setData(array_merge($result->getData(), [
					'sectionConnection' => $link,
				]));
			}
			else if (
				!$result->isSuccess()
				&& $result->getData()['error'] === 404
				&& $section->getExternalType() === 'local'
			)
			{
				$this->deleteSectionConnection($link);
				$sectionContext->setSectionConnection(null);
				$result = $this->syncManager->createSection($section, $sectionContext);
			}
		}
		else
		{
			$result = new Result();
		}
	}
	else
	{
		$result = $this->syncManager->createSection($section, $sectionContext);
	}

	return $result;
}