• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/office365/startsynccontroller.php
  • Класс: BitrixCalendarSyncOffice365StartSyncController
  • Вызов: StartSyncController::initSubscription
private function initSubscription(Connection $connection): Result
{
	$result = new Result();
	try
	{
		$links = (new CoreMappersSectionConnection())->getMap([
			'=CONNECTION_ID' => $connection->getId(),
			'=ACTIVE' => 'Y'
		]);
		$manager = $this->getOutgoingManager($connection);
		foreach ($links as $link)
		{
			try
			{
				$manager->subscribeSection($link);
			}
			catch (Exception $e)
			{
				$result->addError(new Error($e->getMessage(), $e->getCode()));
			}
		}
	}
	catch (Exception $e)
	{
		$result->addError(new Error($e->getMessage(), $e->getCode()));
	}

	return $result;
}