• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/managers/outgoingsectionmanager.php
  • Класс: BitrixCalendarSyncManagersOutgoingSectionManager
  • Вызов: OutgoingSectionManager::clearBrokenSyncSection
private function clearBrokenSyncSection(SyncEntitiesSyncSection $syncSection)
{
	global $DB;
	$sql = "DELETE link FROM b_calendar_event_connection link
			inner join b_calendar_event as event ON event.ID=link.EVENT_ID
		where event.SECTION_ID = '" . $syncSection->getSection()->getId() . "'
		and link.CONNECTION_ID = '". $syncSection->getSectionConnection()->getConnection()->getId() ."'
	";
	$DB->Query($sql);
	(new CoreMappersSectionConnection())->delete(
		$syncSection->getSectionConnection(),
		['softDelete' => false]
	);
	$syncSection->setSectionConnection(null);
}