...Человеческий поиск в разработке...
- Модуль: calendar
- Путь к файлу: ~/bitrix/modules/calendar/lib/rooms/manager.php
- Класс: BitrixCalendarRoomsManager
- Вызов: Manager::deleteLocationFromEvents
public function deleteLocationFromEvents(): Manager { if ($this->getError()) { return $this; } global $DB; $guestsId = []; $idTemp = "(#ID#, ''),"; $updateString = ''; $id = $this->room->getId(); $locationName = $this->room->getName(); $locationId = 'calendar_' . $id; $events = $DB->Query(" SELECT ID, PARENT_ID, OWNER_ID, CREATED_BY, LOCATION FROM b_calendar_event WHERE LOCATION LIKE '" . $locationId . "%'; "); while ($event = $events->Fetch()) { if ($event['ID'] === $event['PARENT_ID']) { $guestsId[] = $event['OWNER_ID']; } $updateString .= str_replace('#ID#', $event['ID'], $idTemp); } if ($updateString) { $updateString = substr($updateString, 0, -1); $DB->Query(" INSERT INTO b_calendar_event (ID, LOCATION) VALUES ".$updateString." ON DUPLICATE KEY UPDATE LOCATION = VALUES(LOCATION) "); $guestsId = array_unique($guestsId); $userId = CCalendar::GetCurUserId(); foreach ($guestsId as $guestId) { CCalendarNotify::Send([ 'mode' => 'delete_location', 'location' => $locationName, 'locationId' => $id, 'guestId' => (int)$guestId, 'userId' => $userId, ]); } } return $this; }