• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/managers/vendordataexchangemanager.php
  • Класс: BitrixCalendarSyncManagersVendorDataExchangeManager
  • Вызов: VendorDataExchangeManager::removeDeletedExternalSections
private function removeDeletedExternalSections(SyncEntitiesSyncSectionMap $externalSectionMap): void
{
	if (!$this->isFullSync)
	{
		return;
	}

	$deleteCandidates = (new SyncEntitiesSyncSectionMap(
		array_diff_key($this->syncSectionMap->getCollection(), $externalSectionMap->getCollection()),
	))->getNonLocalSections();

	/** @var SyncEntitiesSyncSection $syncSection */
	foreach ($deleteCandidates as $syncSection)
	{
		if (
			($syncSection->getSection() === null)
			|| ($syncSection->getSectionConnection() === null)
		)
		{
			continue;
		}
		$this->deleteSyncSectionFromLocalStorage($syncSection);
	}
}