• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/managers/outgoingmanager.php
  • Класс: BitrixCalendarSyncManagersOutgoingManager
  • Вызов: OutgoingManager::exportSectionSimple
public function exportSectionSimple(CoreSectionSection $section): Result
{
	$resultData = [];
	$mainResult = new Result();
	$sectionContext = new SectionContext();

	if ($link = $this->getSectionLink($section))
	{
		$sectionContext->setSectionConnection($link);
		if ($link->isActive())
		{
			$result = $this->syncManager->updateSection($section, $sectionContext);
			if ($result->isSuccess())
			{
				$resultData['updated'] = $link;
			}
			else
			{
				$resultData['error'] = $link;
			}
		}
		else
		{
			$resultData['skipped'] = $link;
		}
	}
	elseif ($section->getExternalType() !== CoreSectionSection::LOCAL_EXTERNAL_TYPE)
	{
		$resultData['skipped'] = $section;
	}
	else
	{
		$result = $this->syncManager->createSection($section, $sectionContext);
		if (!empty($result->getData()['sectionConnection']))
		{
			$resultData['exported'] = $result->getData()['sectionConnection'];
		}
		else
		{
			$result->addError(new Error('Error of export section'));
			$resultData['section'] = $section;
		}
	}

	return $mainResult->setData($resultData);
}