- Модуль: calendar
- Путь к файлу: ~/bitrix/modules/calendar/classes/general/calendar_event.php
- Класс: CCalendarEvent
- Вызов: CCalendarEvent::CleanEventsWithDeadParents
static function CleanEventsWithDeadParents()
{
global $DB;
$strSql = "SELECT PARENT_ID from b_calendar_event where PARENT_ID in (SELECT ID from b_calendar_event where MEETING_STATUS='H' and DELETED='Y') AND DELETED='N'";
$res = $DB->Query($strSql, false, "FILE: ".__FILE__."
LINE: ".__LINE__);
$strItems = "0";
while($result = $res->Fetch())
{
$strItems .= ",". (int)$result['ID'];
}
if ($strItems != "0")
{
$strSql =
"UPDATE b_calendar_event SET ".
$DB->PrepareUpdate("b_calendar_event", array("DELETED" => "Y")).
" WHERE PARENT_ID in (".$strItems.")";
$DB->Query($strSql, false, "File: ".__FILE__."
Line: ".__LINE__);
}
CCalendar::ClearCache(['section_list', 'event_list']);
}