• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/office365/apiservice.php
  • Класс: Bitrix\Calendar\Sync\Office365\ApiService
  • Вызов: ApiService::updateEvent
public function updateEvent(EventDto $eventDto, string $vendorEventId): array
{
	if ($eventDto->isCancelled)
	{
		$response = $this->apiClient->post(
			'me/events/' . $vendorEventId . '/cancel',
			[
				'Comment' => 'Deleted from Bitrix',
			]
		);
	}
	else
	{
		try
		{
			$response = $this->apiClient->patch(
				'me/events/' . $vendorEventId,
				array_filter($eventDto->toArray(true), static function ($val) {
					return $val !== [] && $val !== null;
				})
			);
		}
		catch (NotFoundException $exception)
		{
			return [];
		}
	}

	return $response;
}