- Модуль: rest
- Путь к файлу: ~/bitrix/modules/rest/lib/api/event.php
- Класс: BitrixRestApiEvent
- Вызов: Event::eventOfflineError
static function eventOfflineError($query, $n, CRestServer $server)
{
if($server->getAuthType() !== Auth::AUTH_TYPE)
{
throw new AuthTypeException();
}
if(!CRestUtil::isAdmin())
{
throw new AccessException();
}
$query = array_change_key_case($query, CASE_LOWER);
$processId = isset($query['process_id']) ? trim($query['process_id']) : null;
$messageId = isset($query['message_id']) ? $query['message_id'] : null;
$authData = $server->getAuthData();
$connectorId = isset($authData['auth_connector']) ? $authData['auth_connector'] : '';
if($processId === null)
{
throw new ArgumentNullException('PROCESS_ID');
}
if(!is_array($messageId))
{
throw new ArgumentException('Value must be array of MESSAGE_ID values', 'message_id');
}
$clientInfo = AppTable::getByClientId($server->getClientId());
if(count($messageId) > 0)
{
EventOfflineTable::markError($processId, $clientInfo['ID'], $connectorId, $messageId);
}
return true;
}