Skip to content

Instantly share code, notes, and snippets.

@artemrogov
Created May 2, 2019 17:15
Show Gist options
  • Save artemrogov/424eeec53404ae09c2e6c86dcf36228f to your computer and use it in GitHub Desktop.
Save artemrogov/424eeec53404ae09c2e6c86dcf36228f to your computer and use it in GitHub Desktop.
Выборать все книги каталога с ID = 2
/**
* Выборать все книги каталога с ID = 2
*/
if (CModule::IncludeModule('highloadblock')) {
$id_catalog = 2;
$arHLBlock = Bitrix\Highloadblock\HighloadBlockTable::getById(4)->fetch();
$obEntity = Bitrix\Highloadblock\HighloadBlockTable::compileEntity($arHLBlock);
$strEntityDataClass = $obEntity->getDataClass();
$result = $strEntityDataClass::getList();
$resultFilter = $strEntityDataClass::getList(
array(
'select'=>array('ID','UF_NAME_BOOK','UF_CATALOG_ID_H'),
'filter'=>array('=UF_CATALOG_ID_H'=>$id_catalog),
));
foreach($resultFilter as $res){
echo '<p> ID ELEMENT: '.$res["ID"].' '.$res["UF_NAME_BOOK"].' ID_CATALOG: '.$res["UF_CATALOG_ID_H"].'</p>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment