• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/update/googletonewsync.php
  • Класс: BitrixCalendarUpdateGoogleToNewSync
  • Вызов: GoogleToNewSync::getGoogleEvents
private function getGoogleEvents(): EO_Event_Collection
{
	return EventTable::query()
		->setSelect([
			'ID',
			'ORIGINAL_DATE_FROM',
			'RECURRENCE_ID',
			'DAV_XML_ID',
			'G_EVENT_ID',
			'CAL_DAV_LABEL',
			'VERSION',
			'SYNC_STATUS',
			'SECTION_CONNECTION.CONNECTION_ID',
		])
		->whereNotNull('G_EVENT_ID')
		->where('DELETED', 'N')
		->setLimit(self::PORTION)
		->setOrder(['ID' => 'DESC'])
		->registerRuntimeField(
			'SECTION_CONNECTION',
			new ReferenceField(
				'LINK',
				SectionConnectionTable::getEntity(),
				Join::on('ref.SECTION_ID', 'this.SECTION_ID'),
				['join_type' => Join::TYPE_LEFT]
			)
		)
		->exec()->fetchCollection()
	;
}