R
R
run1822015-08-12 15:26:44
PHP
run182, 2015-08-12 15:26:44

How does filtering by multiple property work in Bitrix?

It is necessary to display elements from several infoblocks with a specific value specified in the multiple property.

$arFilter = Array("IBLOCK_ID"=>array(2, 3), "PROPERTY_ANC_ID"=>2);
  $res = CIBlockElement::GetList(Array("PROPERTY_START_DATE" => "DESC"), $arFilter, false, false, $arSelect);
  while($ob = $res->GetNextElement()) {
    $arCalendar[] = $ob->GetFields();
    $arPropsC = $ob->GetProperties();
    
    echo '<pre>'; print_r($arCalendar); echo '</pre>';
  }

Tried in this way, displays only elements from the last infoblock. How can such a filter be organized in the right way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
run182, 2015-08-12
@run182

Understood. You need to add a filter to the array

"LOGIC"=>"OR", 
        array("IBLOCK_ID"=>2, "PROPERTY_ANC_ID"=>2), 
        array("IBLOCK_ID"=>3, "PROPERTY_ANC_ID"=>2)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question