Last active
February 6, 2025 15:53
-
-
Save s2ar/a7e31d4e488f03ebff77 to your computer and use it in GitHub Desktop.
bitrix highloadblock getList
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(!CModule::IncludeModule('highloadblock')) die(); | |
use Bitrix\Highloadblock as HL; | |
use Bitrix\Main\Entity; | |
$hlblock = HL\HighloadBlockTable::getById(5)->fetch(); | |
$hlEntity = HL\HighloadBlockTable::compileEntity($hlblock); | |
$entDataClass = $hlEntity->getDataClass(); | |
$sTableID = 'tbl_'.$hlblock['TABLE_NAME']; | |
$arFilter = array(); //задаете фильтр по вашим полям | |
$rsData = $entDataClass::getList(array( | |
"select" => array('*'), //выбираем все поля | |
"filter" => $arFilter, | |
"order" => array("UF_NAME"=>"ASC") // сортировка по полю UF_SORT, будет работать только, если вы завели такое поле в hl'блоке | |
)); | |
$rsData = new CDBResult($rsData, $sTableID); | |
while($arRes = $rsData->Fetch()){ | |
var_dump($arRes); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment