本文整理匯總了PHP中Bitrix\Sale\Location\LocationTable::updateExtended方法的典型用法代碼示例。如果您正苦於以下問題:PHP LocationTable::updateExtended方法的具體用法?PHP LocationTable::updateExtended怎麽用?PHP LocationTable::updateExtended使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Bitrix\Sale\Location\LocationTable
的用法示例。
在下文中一共展示了LocationTable::updateExtended方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: UpdateCity
public static function UpdateCity($ID, $arFields)
{
global $DB;
$ID = intval($ID);
if ($ID <= 0 || !CSaleLocation::CityCheckFields("UPDATE", $arFields)) {
return false;
}
foreach (GetModuleEvents("sale", "OnBeforeCityUpdate", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID, &$arFields)) === false) {
return false;
}
}
if (self::isLocationProMigrated()) {
try {
$locId = self::getLocationIdByCityId($ID);
if (!$locId) {
return false;
}
$res = Location\LocationTable::updateExtended($locId, self::refineFieldsForSaveCRC($locId, $arFields), array('REBALANCE' => false));
if ($res->isSuccess()) {
return $ID;
}
return false;
} catch (Exception $e) {
return false;
}
} else {
$strUpdate = $DB->PrepareUpdate("b_sale_location_city", $arFields);
$strSql = "UPDATE b_sale_location_city SET " . $strUpdate . " WHERE ID = " . $ID . "";
$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
$db_lang = CLangAdmin::GetList($b = "sort", $o = "asc", array("ACTIVE" => "Y"));
while ($arLang = $db_lang->Fetch()) {
if ($arCntLang = CSaleLocation::GetCityLangByID($ID, $arLang["LID"])) {
$strUpdate = $DB->PrepareUpdate("b_sale_location_city_lang", $arFields[$arLang["LID"]]);
$strSql = "UPDATE b_sale_location_city_lang SET " . $strUpdate . " WHERE ID = " . $arCntLang["ID"] . "";
} else {
$arInsert = $DB->PrepareInsert("b_sale_location_city_lang", $arFields[$arLang["LID"]]);
$strSql = "INSERT INTO b_sale_location_city_lang(CITY_ID, " . $arInsert[0] . ") " . "VALUES(" . $ID . ", " . $arInsert[1] . ")";
}
$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
}
}
foreach (GetModuleEvents("sale", "OnCityUpdate", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID, $arFields));
}
return $ID;
}