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