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


PHP CIBlockElement::MkPropertyFilter方法代碼示例

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


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

示例1: MkFilter


//.........這裏部分代碼省略.........
                 if ($cOperationType == "N") {
                     if (array_key_exists("", $arSections)) {
                         $arSectionFilter["BE"][] = "BE.IN_SECTIONS<>'N'";
                         $arSectionFilter["LOGIC"] = "AND";
                         unset($arSections[""]);
                         if (count($arSections) > 0) {
                             $arSectionFilter["BS"][] = "BS.CODE NOT IN ('" . implode("', '", $arSections) . "')";
                         }
                     } elseif (count($arSections) > 0) {
                         $arSectionFilter["BE"][] = "BE.IN_SECTIONS='N'";
                         $arSectionFilter["LOGIC"] = "OR";
                         $arSectionFilter["BS"][] = "BS.CODE NOT IN ('" . implode("', '", $arSections) . "')";
                     }
                 } else {
                     if (array_key_exists("", $arSections)) {
                         $arSectionFilter["BE"][] = "BE.IN_SECTIONS='N'";
                         $arSectionFilter["LOGIC"] = "OR";
                         unset($arSections[""]);
                     }
                     if (count($arSections) > "") {
                         $arSectionFilter["BS"][] = "BS.CODE IN ('" . implode("', '", $arSections) . "')";
                     }
                 }
                 break;
             case "PROPERTY":
                 foreach ($val as $propID => $propVAL) {
                     $res = CIBlock::MkOperationFilter($propID);
                     $res["LOGIC"] = $Logic;
                     $res["LEFT_JOIN"] = $bPropertyLeftJoin;
                     if (preg_match("/^([^.]+)\\.([^.]+)\$/", $res["FIELD"], $arMatch)) {
                         $db_prop = CIBlockProperty::GetPropertyArray($arMatch[1], CIBlock::_MergeIBArrays($arFilter["IBLOCK_ID"], $arFilter["IBLOCK_CODE"], $arFilter["~IBLOCK_ID"], $arFilter["~IBLOCK_CODE"]));
                         if (is_array($db_prop) && $db_prop["PROPERTY_TYPE"] == "E") {
                             $res["FIELD"] = $arMatch;
                             CIBlockElement::MkPropertyFilter($res, $cOperationType, $propVAL, $db_prop, $arJoinProps, $arSqlSearch);
                         }
                     } else {
                         if ($db_prop = CIBlockProperty::GetPropertyArray($res["FIELD"], CIBlock::_MergeIBArrays($arFilter["IBLOCK_ID"], $arFilter["IBLOCK_CODE"], $arFilter["~IBLOCK_ID"], $arFilter["~IBLOCK_CODE"]))) {
                             CIBlockElement::MkPropertyFilter($res, $cOperationType, $propVAL, $db_prop, $arJoinProps, $arSqlSearch);
                         }
                     }
                 }
                 break;
             default:
                 if (is_numeric($orig_key)) {
                     //Here is hint for better property resolution:
                     if (!is_array($val) || !array_key_exists("~IBLOCK_ID", $val)) {
                         if (array_key_exists("IBLOCK_ID", $arFilter)) {
                             $val["~IBLOCK_ID"] = $arFilter["IBLOCK_ID"];
                         } elseif (array_key_exists("~IBLOCK_ID", $arFilter)) {
                             $val["~IBLOCK_ID"] = $arFilter["~IBLOCK_ID"];
                         }
                     }
                     if (!is_array($val) || !array_key_exists("~IBLOCK_CODE", $val)) {
                         if (array_key_exists("IBLOCK_CODE", $arFilter)) {
                             $val["~IBLOCK_CODE"] = $arFilter["IBLOCK_CODE"];
                         } elseif (array_key_exists("~IBLOCK_CODE", $arFilter)) {
                             $val["~IBLOCK_CODE"] = $arFilter["~IBLOCK_CODE"];
                         }
                     }
                     //Subfilter process
                     $arSubSqlSearch = CIBlockElement::MkFilter($val, $arJoinProps, $arAddWhereFields, $level + 1, $bPropertyLeftJoin);
                     if (strlen(trim($arSubSqlSearch[0], "\n\t"))) {
                         $arSqlSearch[] = str_replace("\n\t\t\t", "\n\t\t\t\t", $arSubSqlSearch[0]);
                     }
                 } elseif (strtoupper(substr($key, 0, 8)) == "CATALOG_" && CModule::IncludeModule("catalog")) {
                     $res_catalog = CCatalogProduct::GetQueryBuildArrays(array(), array($orig_key => $val), array());
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:67,代碼來源:iblockelement.php


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