• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/classes/general/im_rest.php
  • Класс: CIMRestService
  • Вызов: CIMRestService::notifyReadList
static function notifyReadList($arParams, $n, CRestServer $server)
{
	$arParams = array_change_key_case($arParams, CASE_UPPER);

	if (!isset($arParams['ACTION']))
	{
		$arParams['ACTION'] = 'Y';
	}

	if (!isset($arParams['IDS']) || !is_array($arParams['IDS']))
	{
		throw new BitrixRestRestException("No IDS param or it is not an array", "PARAMS_ERROR", CRestServer::STATUS_WRONG_REQUEST);
	}

	$CIMNotify = new CIMNotify();
	foreach ($arParams['IDS'] as $notificationId)
	{
		$notificationId = (int)$notificationId;
		if ($notificationId <= 0)
		{
			break;
		}

		if ($arParams['ACTION'] === 'Y')
		{
			$CIMNotify->MarkNotifyRead($notificationId);
		}
		else
		{
			$CIMNotify->MarkNotifyUnRead($notificationId);
		}
	}

	return true;
}