T
T
Timur Kalimullin2014-10-09 13:51:10
PHP
Timur Kalimullin, 2014-10-09 13:51:10

How to select several Bitrix infoblock elements by ID array?

Good afternoon, faced with a simple problem for which I can not find a rational solution.
There is an element in which, using the 'Binding to elements in the form of a list' property, I specify which elements from another infoblock should be displayed in the future.
Example: For an element (from ib Portfolio) on the page, display what services were applied to this work. Each service is a link and the name of the linked element of the Services infoblock.
In the toga, I have an array with the ID of the attached elements, I need to get their name and page address.
Through CIBlockElement::GetList - arFilter is impossible, because ID can only contain a numeric value.
Do not use the same loop for each ID!?
With what component or code can this be implemented? The task is trivial.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Savrasov, 2014-10-11
@alcorn

Actually, arFilter array values ​​support arrays.

$arFilter = Array("IBLOCK_ID"=>1, "ID"=>array(1,2,3));
$res = CIBlockElement::GetList(Array(), $arFilter, false, false, array());
while($ob = $res->Fetch())
{
 
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question