• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/office365/sectionmanager.php
  • Класс: Bitrix\Calendar\Sync\Office365\SectionManager
  • Вызов: SectionManager::update
public function update(Section $section, SectionContext $context): Result
{
	$result = new Result();
	$sectionLink = $context->getSectionConnection();

	$dto = new SectionDto([
		'name' => $this->getSectionName($sectionLink->getSection()),
		'id' => $context->getSectionConnection()->getVendorSectionId(),
		// 'color' => ColorConverter::toOffice(
		// 	$sectionLink->getSection()->getColor()
		// )
	]);
	try
	{
		if ($sectionLink->isPrimary())
		{
			$dto->name = null;
		}
		$sectionDto = $this->context->getVendorSyncService()->updateSection($dto);
		$result->setData([
			'id' => $sectionDto->id,
			'version' => $sectionDto->changeKey,
			'sectionConnection' => $sectionLink,
		]);
	}
	catch (NotFoundException $e)
	{
		throw $e;
	}
	catch (Exception $e)
	{
		$result->addError(new Error($e->getMessage()));
	}

	return $result;
}