• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/managers/outgoingmanager.php
  • Класс: BitrixCalendarSyncManagersOutgoingManager
  • Вызов: OutgoingManager::exportSections
public function exportSections(array $params = []): Result
{
	$mainResult = new Result();
	$resultData = [
		'links' => [
			'exported' => [],
			'updated' => [],
			'skipped' => [],
			'error' => [],
		],
		'exportErr' => [],
	];

	$excludeIds = $params['excludeIds'] ?? [];
	/** @var CoreSectionSection $section */
	foreach ($this->fetchSections($excludeIds) as $section)
	{
		$sectionResult = $this->exportSectionSimple($section);
		if ($sectionResult->isSuccess())
		{
			foreach ($sectionResult->getData() as $key => $link)
			{
				$resultData['links'][$key][] = $link;
			}
			$resultData['exported'][] = $section->getId();
		}
		else
		{
			$mainResult->addErrors($sectionResult->getErrors());
			$resultData['exportErr'][] = $section->getId();
		}
	}

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