• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/google/outgoingeventmanager.php
  • Класс: BitrixCalendarSyncGoogleOutgoingEventManager
  • Вызов: OutgoingEventManager::exportBatch
private function exportBatch(array $syncEventList, SyncSection $syncSection, ?array $syncEventInstanceList = null): void
{

	// single or recurrence
	foreach (array_chunk($syncEventList, self::CHUNK_LENGTH) as $batch)
	{
		$body = $this->prepareMultipartMixed($batch, $syncSection);
		// TODO: Remake it: move this logic to parent::request().
		// Or, better, in separate class.
		$this->httpClient->post(self::BATCH_PATH, $body);

		$this->multipartDecode($this->httpClient->getResult(), $syncEventList);
	}

	// instances
	if ($syncEventInstanceList !== null)
	{
		foreach (array_chunk($syncEventInstanceList, self::CHUNK_LENGTH) as $batch)
		{
			$body = $this->prepareMultipartMixed($batch, $syncSection, $syncEventList);
			// TODO: Remake it: move this logic to parent::request().
			// Or, better, in separate class.
			$this->httpClient->post(self::BATCH_PATH, $body);

			$this->multipartDecode($this->httpClient->getResult(), $syncEventList);
		}
	}
}