- Модуль: imopenlines
- Путь к файлу: ~/bitrix/modules/imopenlines/lib/rest.php
- Класс: BitrixImOpenLinesRest
- Вызов: Rest::configUpdate
static function configUpdate($arParams, $n, CRestServer $server)
{
$result = false;
$arParams['CONFIG_ID'] = (int)$arParams['CONFIG_ID'];
if ($arParams['CONFIG_ID'] <= 0)
{
throw new RestException('Config ID can't be empty', 'CONFIG_ID_EMPTY', CRestServer::STATUS_WRONG_REQUEST);
}
if (!Config::canEditLine($arParams['CONFIG_ID']))
{
throw new RestException('Permission denied', 'CONFIG_WRONG_USER_PERMISSION', CRestServer::STATUS_FORBIDDEN);
}
$arParams['PARAMS'] = !empty($arParams['PARAMS']) && is_array($arParams['PARAMS']) ? $arParams['PARAMS'] : [];
$config = new Config();
$resultUpdate = $config->update($arParams['CONFIG_ID'], $arParams['PARAMS']);
if($resultUpdate->isSuccess())
{
$result = true;
}
return $result;
}