• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/googleapisync.php
  • Класс: BitrixCalendarSyncGoogleApiSync
  • Вызов: GoogleApiSync::getCalendarItems
public function getCalendarItems(string $syncToken = null): array
{
	$this->setColors();
	$response = [];

	if (empty($this->calendarList))
	{
		$response = $this->syncTransport->getCalendarList($this->getCalendarListParams($syncToken));
	}

	if ($response && !empty($response['items']))
	{
		foreach($response['items'] as $calendarItem)
		{
			$calendarItem['backgroundColor'] = $this->getCalendarColor($calendarItem['colorId']);
			$calendarItem['textColor'] = $this->getCalendarColor($calendarItem['colorId'], true);
			$this->calendarList[] = $calendarItem;
		}

		$this->nextSyncToken = $response['nextSyncToken'];
	}


	return $this->calendarList;
}