Files
Bitrix24/iblock/elements.md

21 lines
671 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
### Готовая функция для получения всех полей инфоблока по его ID
```php
$doc = getIblockElement($PRODUCT_ID);
```
### Получаем все элементы по ID инфоблока
```php
$IDBlock = 32;
$arSelect = Array("ID", "NAME","PREVIEW_PICTURE");
$arFilter = Array("IBLOCK_ID"=>IntVal($IDBlock), "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y");
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>50), $arSelect);
while($ob = $res->GetNextElement()) : $arFields = $ob->GetFields();
echo "<pre>";
print_r($arFields);
echo "</pre>";
endwhile;
```