- Модуль: forum
- Путь к файлу: ~/bitrix/modules/forum/classes/general/message.php
- Класс: CALLForumFiles
- Вызов: CALLForumFiles::UpdateByID
static function UpdateByID($ID, $arFields)
{
$ID = (is_array($ID) ? $ID : array($ID));
$arFields = (is_array($arFields) ? $arFields : array($arFields));
$res = array();
foreach ($ID as $val):
$val = intval($val);
if ($val > 0)
$res[] = $val;
endforeach;
$ID = $res;
$res = array();
foreach ($arFields as $key => $val):
if (intval($val) > 0 && in_array($key, array("FORUM_ID", "TOPIC_ID", "MESSAGE_ID")))
$res[$key] = $val;
endforeach;
$arFields = $res;
if (empty($ID) || empty($arFields))
return false;
$strUpdate = $GLOBALS["DB"]->PrepareUpdate("b_forum_file", $arFields);
$strSql = "UPDATE b_forum_file SET ".$strUpdate." WHERE FILE_ID IN(".implode(",", $ID).")";
$GLOBALS["DB"]->Query($strSql, false, "File: ".__FILE__."
Line: ".__LINE__);
}