• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/update/initlocaldatatogoogle.php
  • Класс: BitrixCalendarUpdateInitLocalDataToGoogle
  • Вызов: InitLocalDataToGoogle::getNotSyncLocalConnection
private function getNotSyncLocalConnection(int $lastId): array
{
	global $DB;
	$connections = [];

	$strSql = "SELECT DISTINCT c.*, GROUP_CONCAT(s.ID) as SECTION_LIST"
		. " FROM b_dav_connections c"
		. " INNER JOIN b_calendar_section s ON s.OWNER_ID = c.ENTITY_ID"
		. " WHERE (s.EXTERNAL_TYPE = 'local' OR s.EXTERNAL_TYPE = 'google') AND c.ACCOUNT_TYPE = 'google_api_oauth' AND c.ID > " . $lastId
		. " GROUP BY c.ID"
		. " ORDER BY ID ASC"
		. " LIMIT 3;"
	;
	$connectionsDb = $DB->Query($strSql);

	while ($connection = $connectionsDb->Fetch())
	{
		$connections[] = $connection;
	}

	return $connections;
}