本文整理汇总了PHP中CSocNetLog::CheckFields方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetLog::CheckFields方法的具体用法?PHP CSocNetLog::CheckFields怎么用?PHP CSocNetLog::CheckFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetLog
的用法示例。
在下文中一共展示了CSocNetLog::CheckFields方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Update
function Update($ID, $arFields)
{
global $DB;
$ID = IntVal($ID);
if ($ID <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_L_WRONG_PARAMETER_ID"), "ERROR_NO_ID");
return false;
}
$arFields1 = array();
foreach ($arFields as $key => $value) {
if (substr($key, 0, 1) == "=") {
$arFields1[substr($key, 1)] = $value;
unset($arFields[$key]);
}
}
if (!CSocNetLog::CheckFields("UPDATE", $arFields, $ID)) {
return false;
} else {
$arSiteID = array();
if (is_set($arFields, "SITE_ID")) {
if (is_array($arFields["SITE_ID"])) {
$arSiteID = $arFields["SITE_ID"];
} else {
$arSiteID[] = $arFields["SITE_ID"];
}
$arFields["SITE_ID"] = false;
$str_SiteID = "''";
foreach ($arSiteID as $v) {
$arFields["SITE_ID"] = $v;
$str_SiteID .= ", '" . $DB->ForSql($v) . "'";
}
}
}
$strUpdate = $DB->PrepareUpdate("b_sonet_log", $arFields);
foreach ($arFields1 as $key => $value) {
if (strlen($strUpdate) > 0) {
$strUpdate .= ", ";
}
$strUpdate .= $key . "=" . $value . " ";
}
if (strlen($strUpdate) > 0) {
$strSql = "UPDATE b_sonet_log SET " . "\t" . $strUpdate . " " . "WHERE ID = " . $ID . " ";
$DB->Query($strSql, False, "File: " . __FILE__ . "<br>Line: " . __LINE__);
if (count($arSiteID) > 0) {
$strSql = "DELETE FROM b_sonet_log_site WHERE LOG_ID=" . $ID;
$DB->Query($strSql, false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
$strSql = "INSERT INTO b_sonet_log_site(LOG_ID, SITE_ID) " . "SELECT " . $ID . ", LID " . "FROM b_lang " . "WHERE LID IN (" . $str_SiteID . ") ";
$DB->Query($strSql, false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
}
if (defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->ClearByTag("SONET_LOG_" . $ID);
}
} else {
$ID = False;
}
return $ID;
}