• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/update/eventduplicatecleaner.php
  • Класс: BitrixCalendarUpdateEventDuplicateCleaner
  • Вызов: EventDuplicateCleaner::getLocationEntriesWithEmptyParent
private function getLocationEntriesWithEmptyParent(): ?array
{
	global $DB;
	$strSql = "
		select 
			ce.ID, ce.PARENT_ID, p.ID as PID
		from b_calendar_event ce
		left join b_calendar_event p
		on ce.PARENT_ID=p.ID
		where 
			ce.CAL_TYPE='location'
			and (p.ID is null or p.DELETED='Y')
		limit 1
	";

	$res = $DB->Query($strSql);
	if ($entry = $res->Fetch())
	{
		return $entry;
	}
	return null;
}