當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CIBlockElement::MkAlias方法代碼示例

本文整理匯總了PHP中CIBlockElement::MkAlias方法的典型用法代碼示例。如果您正苦於以下問題:PHP CIBlockElement::MkAlias方法的具體用法?PHP CIBlockElement::MkAlias怎麽用?PHP CIBlockElement::MkAlias使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CIBlockElement的用法示例。


在下文中一共展示了CIBlockElement::MkAlias方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: MkPropertySelect

 function MkPropertySelect($PR_ID, $db_prop, &$arIBlockLongProps, &$arIBlockConvProps, &$arJoinProps, &$arIBlockMultProps, &$arIBlockNumProps, $bWasGroup, $sGroupBy, &$sSelect, $bSort = false)
 {
     global $DB, $DBType;
     if ($bSort && $db_prop["PROPERTY_TYPE"] != "L") {
         return;
     }
     static $arJoinEFields = false;
     //define maximum alias length
     if ($DBType == "oracle" || $DBType == "mssql") {
         $mal = 29;
     } else {
         $mal = false;
     }
     $bSubQuery = isset($this) && is_object($this) && isset($this->subQueryProp);
     $arSelect = array();
     //Joined elements
     if (is_array($PR_ID)) {
         if (!$arJoinEFields) {
             $arJoinEFields = array("ID" => "BE#i#.ID", "TIMESTAMP_X" => $DB->DateToCharFunction("BE#i#.TIMESTAMP_X"), "MODIFIED_BY" => "BE#i#.MODIFIED_BY", "DATE_CREATE" => $DB->DateToCharFunction("BE#i#.DATE_CREATE"), "CREATED_BY" => "BE#i#.CREATED_BY", "IBLOCK_ID" => "BE#i#.IBLOCK_ID", "ACTIVE" => "BE#i#.ACTIVE", "ACTIVE_FROM" => $DB->DateToCharFunction("BE#i#.ACTIVE_FROM"), "ACTIVE_TO" => $DB->DateToCharFunction("BE#i#.ACTIVE_TO"), "SORT" => "BE#i#.SORT", "NAME" => "BE#i#.NAME", "PREVIEW_PICTURE" => "BE#i#.PREVIEW_PICTURE", "PREVIEW_TEXT" => "BE#i#.PREVIEW_TEXT", "PREVIEW_TEXT_TYPE" => "BE#i#.PREVIEW_TEXT_TYPE", "DETAIL_PICTURE" => "BE#i#.DETAIL_PICTURE", "DETAIL_TEXT" => "BE#i#.DETAIL_TEXT", "DETAIL_TEXT_TYPE" => "BE#i#.DETAIL_TEXT_TYPE", "SHOW_COUNTER" => "BE#i#.SHOW_COUNTER", "SHOW_COUNTER_START" => $DB->DateToCharFunction("BE#i#.SHOW_COUNTER_START"), "CODE" => "BE#i#.CODE", "TAGS" => "BE#i#.TAGS", "XML_ID" => "BE#i#.XML_ID", "IBLOCK_SECTION_ID" => "BE#i#.IBLOCK_SECTION_ID", "IBLOCK_TYPE_ID" => "B#i#.IBLOCK_TYPE_ID", "IBLOCK_CODE" => "B#i#.CODE", "IBLOCK_NAME" => "B#i#.NAME", "IBLOCK_EXTERNAL_ID" => "B#i#.XML_ID", "DETAIL_PAGE_URL" => "\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(B#i#.DETAIL_PAGE_URL, '#ID#', BE#i#.ID)\n\t\t\t\t\t, '#ELEMENT_ID#', BE#i#.ID)\n\t\t\t\t\t, '#CODE#', " . $DB->IsNull("BE#i#.CODE", "''") . ")\n\t\t\t\t\t, '#ELEMENT_CODE#', " . $DB->IsNull("BE#i#.CODE", "''") . ")\n\t\t\t\t\t, '#EXTERNAL_ID#', " . $DB->IsNull("BE#i#.XML_ID", "''") . ")\n\t\t\t\t\t, '#IBLOCK_TYPE_ID#', B#i#.IBLOCK_TYPE_ID)\n\t\t\t\t\t, '#IBLOCK_ID#', BE#i#.IBLOCK_ID)\n\t\t\t\t\t, '#IBLOCK_CODE#', " . $DB->IsNull("B#i#.CODE", "''") . ")\n\t\t\t\t\t, '#IBLOCK_EXTERNAL_ID#', " . $DB->IsNull("B#i#.XML_ID", "''") . ")\n\t\t\t\t\t, '#SITE_DIR#', '" . $DB->ForSQL(SITE_DIR) . "')\n\t\t\t\t\t, '#SERVER_NAME#', '" . $DB->ForSQL(SITE_SERVER_NAME) . "')\n\t\t\t\t\t, '#SECTION_ID#', " . $DB->IsNull("BE#i#.IBLOCK_SECTION_ID", "''") . ")\n\t\t\t\t\t, '#SECTION_CODE#', " . $DB->IsNull("BS#i#.CODE", "''") . ")\n\t\t\t\t", "LIST_PAGE_URL" => "\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(\n\t\t\t\t\treplace(B#i#.LIST_PAGE_URL, '#IBLOCK_TYPE_ID#', B#i#.IBLOCK_TYPE_ID)\n\t\t\t\t\t, '#IBLOCK_ID#', BE#i#.IBLOCK_ID)\n\t\t\t\t\t, '#IBLOCK_CODE#', " . $DB->IsNull("B#i#.CODE", "''") . ")\n\t\t\t\t\t, '#IBLOCK_EXTERNAL_ID#', " . $DB->IsNull("B#i#.XML_ID", "''") . ")\n\t\t\t\t\t, '#SITE_DIR#', '" . $DB->ForSQL(SITE_DIR) . "')\n\t\t\t\t\t, '#SERVER_NAME#', '" . $DB->ForSQL(SITE_SERVER_NAME) . "')\n\t\t\t\t");
         }
         //Joined Elements Fields
         if (array_key_exists($PR_ID[2], $arJoinEFields)) {
             if ($db_prop["VERSION"] == 2 && $db_prop["MULTIPLE"] == "N") {
                 //Join properties table if needed
                 if (!array_key_exists($db_prop["IBLOCK_ID"], $arJoinProps["FPS"])) {
                     $arJoinProps["FPS"][$db_prop["IBLOCK_ID"]] = count($arJoinProps["FPS"]);
                 }
                 $iPropCnt = $arJoinProps["FPS"][$db_prop["IBLOCK_ID"]];
             } else {
                 //Join property metadata table
                 if (!array_key_exists($db_prop["ID"], $arJoinProps["FP"])) {
                     $arJoinProps["FP"][$db_prop["ID"]] = array("CNT" => count($arJoinProps["FP"]), "bFullJoin" => false);
                 }
                 //Join multiple values properties table if needed
                 if (!array_key_exists($db_prop["ID"], $arJoinProps["FPV"])) {
                     $arJoinProps["FPV"][$db_prop["ID"]] = array("CNT" => count($arJoinProps["FPV"]), "IBLOCK_ID" => $db_prop["IBLOCK_ID"], "MULTIPLE" => $db_prop["MULTIPLE"], "VERSION" => $db_prop["VERSION"], "ORIG_ID" => $db_prop["ORIG_ID"], "JOIN" => $arJoinProps["FP"][$db_prop["ID"]]["CNT"], "bFullJoin" => false);
                 }
                 $iPropCnt = $arJoinProps["FPV"][$db_prop["ID"]]["CNT"];
             }
             //Then join elements
             if (!array_key_exists($db_prop["ID"], $arJoinProps["BE"])) {
                 $arJoinProps["BE"][$db_prop["ID"]] = array("CNT" => count($arJoinProps["BE"]), "MULTIPLE" => $db_prop["MULTIPLE"], "VERSION" => $db_prop["VERSION"], "ORIG_ID" => $db_prop["ORIG_ID"], "JOIN" => $iPropCnt, "bJoinIBlock" => false, "bJoinSection" => false);
             }
             $iElCnt = $arJoinProps["BE"][$db_prop["ID"]]["CNT"];
             //Check if b_iblock have to be joined also
             if ($PR_ID[2] == "LIST_PAGE_URL" || $PR_ID[2] == "IBLOCK_TYPE_ID" || $PR_ID[2] == "IBLOCK_CODE" || $PR_ID[2] == "IBLOCK_NAME" || $PR_ID[2] == "IBLOCK_EXTERNAL_ID") {
                 $arJoinProps["BE"][$db_prop["ID"]]["bJoinIBlock"] = true;
             }
             //Check if b_iblock_section have to be joined also
             if ($PR_ID[2] == "DETAIL_PAGE_URL") {
                 $arJoinProps["BE"][$db_prop["ID"]]["bJoinIBlock"] = true;
                 $arJoinProps["BE"][$db_prop["ID"]]["bJoinSection"] = true;
             }
             $arSelect[str_replace("#i#", $iElCnt, $arJoinEFields[$PR_ID[2]])] = CIBlockElement::MkAlias($mal, "PROPERTY_" . $PR_ID[1] . "_" . $PR_ID[2], $arIBlockLongProps);
         } elseif (substr($PR_ID[2], 0, 9) == "PROPERTY_") {
             $jProp_ID = substr($PR_ID[2], 9);
             $db_jprop = CIBlockProperty::GetPropertyArray($jProp_ID, CIBlock::_MergeIBArrays($db_prop["LINK_IBLOCK_ID"]));
             if (is_array($db_jprop)) {
                 if ($db_prop["VERSION"] == 2 && $db_prop["MULTIPLE"] == "N") {
                     //Join properties table if needed
                     if (!array_key_exists($db_prop["IBLOCK_ID"], $arJoinProps["FPS"])) {
                         $arJoinProps["FPS"][$db_prop["IBLOCK_ID"]] = count($arJoinProps["FPS"]);
                     }
                     $iPropCnt = $arJoinProps["FPS"][$db_prop["IBLOCK_ID"]];
                 } else {
                     //Join property metadata table
                     if (!array_key_exists($db_prop["ID"], $arJoinProps["FP"])) {
                         $arJoinProps["FP"][$db_prop["ID"]] = array("CNT" => count($arJoinProps["FP"]), "bFullJoin" => false);
                     }
                     //Join multiple values properties table if needed
                     if (!array_key_exists($db_prop["ID"], $arJoinProps["FPV"])) {
                         $arJoinProps["FPV"][$db_prop["ID"]] = array("CNT" => count($arJoinProps["FPV"]), "IBLOCK_ID" => $db_prop["IBLOCK_ID"], "MULTIPLE" => $db_prop["MULTIPLE"], "VERSION" => $db_prop["VERSION"], "JOIN" => $arJoinProps["FP"][$db_prop["ID"]]["CNT"], "bFullJoin" => false);
                     }
                     $iPropCnt = $arJoinProps["FPV"][$db_prop["ID"]]["CNT"];
                 }
                 //Then join elements
                 if (!array_key_exists($db_prop["ID"], $arJoinProps["BE"])) {
                     $arJoinProps["BE"][$db_prop["ID"]] = array("CNT" => count($arJoinProps["BE"]), "MULTIPLE" => $db_prop["MULTIPLE"], "VERSION" => $db_prop["VERSION"], "ORIG_ID" => $db_prop["ORIG_ID"], "JOIN" => $iPropCnt, "bJoinIBlock" => false, "bJoinSection" => false);
                 }
                 $iElCnt = $arJoinProps["BE"][$db_prop["ID"]]["CNT"];
                 if ($db_jprop["USER_TYPE"] != "") {
                     $arUserType = CIBlockProperty::GetUserType($db_jprop["USER_TYPE"]);
                     if (array_key_exists("ConvertFromDB", $arUserType)) {
                         $arIBlockConvProps["PROPERTY_" . $PR_ID[1] . "_" . $PR_ID[2] . "_VALUE"] = array("ConvertFromDB" => $arUserType["ConvertFromDB"], "PROPERTY" => $db_jprop);
                     }
                 }
                 $comp_prop_id = $db_jprop["ID"] . "~" . $db_prop["ID"];
                 //Infoblock+ (property stored in separate table)
                 if ($db_jprop["VERSION"] == 2) {
                     //This is single value property
                     if ($db_jprop["MULTIPLE"] == "N") {
                         //For numbers we will need special processing in CIBlockResult::Fetch
                         if ($db_jprop["PROPERTY_TYPE"] == "N") {
                             $arIBlockNumProps["PROPERTY_" . $PR_ID[1] . "_" . $PR_ID[2] . "_VALUE"] = $db_prop;
                         }
                         //Enum single property
                         if ($db_jprop["PROPERTY_TYPE"] == "L") {
                             //Join properties table if needed
                             if (!array_key_exists($db_jprop["IBLOCK_ID"], $arJoinProps["BE_FPS"])) {
                                 $arJoinProps["BE_FPS"][$db_jprop["IBLOCK_ID"]] = array("CNT" => count($arJoinProps["BE_FPS"]), "JOIN" => $iElCnt);
//.........這裏部分代碼省略.........
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:101,代碼來源:iblockelement.php


注:本文中的CIBlockElement::MkAlias方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。