Answer the question
In order to leave comments, you need to log in
How to filter using CIBlockElement::SubQuery()?
CIBlockElement::SubQuery();
does not filter by ACTIVE
(or any other field/property). The filter is not applied. Outputs all elements.
$elementObj = CIBlockElement::GetList(
[],
[
'IBLOCK_ID' => 4,
//'PROPERTY_REL_ID.ACTIVE' => 'N', // Это работает!
'ID' => CIBlockElement::SubQuery('PROPERTY_REL_ID', [
'IBLOCK_ID' => 1,
'ACTIVE' => 'N'
]),
],
false,
false,
['ID', 'IBLOCK_ID', 'NAME']
);
while ($elementArray = $elementObj->Fetch()) {
$resultArray[] = $elementArray;
}
$arFilter = ['PROPERTY_REL_ID.ACTIVE' => 'N']
, then filters. But I need a filter by property.
Answer the question
In order to leave comments, you need to log in
Try like this:
[
'IBLOCK_ID' => 4,
'PROPERTY_REL_ID' => CIBlockElement::SubQuery('ID', [
'IBLOCK_ID' => 1,
'ACTIVE' => 'N'
]),
],
false,
false,
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question