• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/office365/eventmanager.php
  • Класс: Bitrix\Calendar\Sync\Office365\EventManager
  • Вызов: EventManager::update
public function update(Core\Event\Event $event, EventContext $context): Result
{
	$result = new Result();
	$internalDto = $this->getEventConverter()->eventToDto($event);
	$this->enrichVendorData($internalDto, $context->getEventConnection());

	try
	{
		$dto = $this->getService()->updateEvent($context->getEventConnection()->getVendorEventId(), $internalDto);
		if ($dto)
		{
			$result->setData($this->prepareResultData($dto));
		}
	}
	catch (ApiException $exception)
	{
		if ((int)$exception->getCode() !== 400)
		{
			throw $exception;
		}

		$result->addError(new Main\Error($exception->getMessage(), $exception->getCode()));
	}
	catch (AuthException $exception)
	{
		$result->addError(new Main\Error($exception->getMessage(), $exception->getCode()));
	}

	return $result;
}