• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/handlers/synceventmergehandler.php
  • Класс: BitrixCalendarSyncHandlersSyncEventMergeHandler
  • Вызов: SyncEventMergeHandler::removeClosestRemind
private function removeClosestRemind(?CoreEventPropertiesRemindCollection $remindCollection)
{
	$minValue = null;
	$minIndex = null;

	/** @var CoreEventPropertiesRemind $item */
	foreach ($remindCollection->getCollection() as $index => $item)
	{
		$offset = $item->getTimeBeforeStartInMinutes();
		if ($offset < 0)
		{
			continue;
		}

		if ($minValue === null || $offset < $minValue)
		{
			$minValue = $offset;
			$minIndex = $index;
		}
	}
	if ($minIndex !== null)
	{
		$remindCollection->remove($minIndex);
	}
}