当前位置: 首页>>代码示例>>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;未经允许,请勿转载。