本文整理匯總了PHP中CIBlock::_transaction_lock方法的典型用法代碼示例。如果您正苦於以下問題:PHP CIBlock::_transaction_lock方法的具體用法?PHP CIBlock::_transaction_lock怎麽用?PHP CIBlock::_transaction_lock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CIBlock
的用法示例。
在下文中一共展示了CIBlock::_transaction_lock方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: TreeReSort
public static function TreeReSort($IBLOCK_ID, $ID = 0, $cnt = 0, $depth = 0, $ACTIVE = "Y")
{
global $DB;
$IBLOCK_ID = IntVal($IBLOCK_ID);
if ($ID == 0) {
CIBlock::_transaction_lock($IBLOCK_ID);
}
if ($ID > 0) {
$DB->Query("\n\t\t\t\tUPDATE\n\t\t\t\t\tb_iblock_section\n\t\t\t\tSET\n\t\t\t\t\tTIMESTAMP_X=" . ($DB->type == "ORACLE" ? "NULL" : "TIMESTAMP_X") . "\n\t\t\t\t\t,RIGHT_MARGIN=" . IntVal($cnt) . "\n\t\t\t\t\t,LEFT_MARGIN=" . IntVal($cnt) . "\n\t\t\t\tWHERE\n\t\t\t\t\tID=" . IntVal($ID));
}
$strSql = "\n\t\t\tSELECT BS.ID, BS.ACTIVE\n\t\t\tFROM b_iblock_section BS\n\t\t\tWHERE BS.IBLOCK_ID = " . $IBLOCK_ID . "\n\t\t\tAND " . ($ID > 0 ? "BS.IBLOCK_SECTION_ID=" . IntVal($ID) : "BS.IBLOCK_SECTION_ID IS NULL") . "\n\t\t\tORDER BY BS.SORT, BS.NAME\n\t\t";
$cnt++;
$res = $DB->Query($strSql);
while ($arr = $res->Fetch()) {
$cnt = CIBlockSection::TreeReSort($IBLOCK_ID, $arr["ID"], $cnt, $depth + 1, $ACTIVE == "Y" && $arr["ACTIVE"] == "Y" ? "Y" : "N");
}
if ($ID == 0) {
return true;
}
$DB->Query("\n\t\t\tUPDATE\n\t\t\t\tb_iblock_section\n\t\t\tSET\n\t\t\t\tTIMESTAMP_X=" . ($DB->type == "ORACLE" ? "NULL" : "TIMESTAMP_X") . "\n\t\t\t\t,RIGHT_MARGIN=" . IntVal($cnt) . "\n\t\t\t\t,DEPTH_LEVEL=" . IntVal($depth) . "\n\t\t\t\t,GLOBAL_ACTIVE='" . $ACTIVE . "'\n\t\t\tWHERE\n\t\t\t\tID=" . IntVal($ID));
return $cnt + 1;
}