本文整理汇总了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;
}