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