Битрикс: свойство «Справочник» в шаблоне компонента

CModule::IncludeModule(«highloadblock»);
use Bitrix\Highloadblock as HL;
use Bitrix\Main\Entity;

$hlblock_id = 2;
$hlblock = HL\HighloadBlockTable::getById($hlblock_id)->fetch();

$entity = HL\HighloadBlockTable::compileEntity($hlblock);
$entity_data_class = $entity->getDataClass();
$entity_table_name = $hlblock[‘TABLE_NAME’];

$arFilter = array(‘UF_XML_ID’ => $arItem[‘PROPERTIES’][‘BRANDS_REF’][‘VALUE’]);
$sTableID = ‘tbl_’.$entity_table_name;
$rsData = $entity_data_class::getList(array(
«select» => array(‘*’),
«filter» => $arFilter,
«order» => array()
));
$rsData = new CDBResult($rsData, $sTableID);
$HLBrands = array();
while($arRes = $rsData->Fetch())
{
$arItem[‘BRAND’][‘BRAND_LOGO’] = CFile::GetFileArray($arRes[‘UF_FILE’]);
$arItem[‘BRAND’][‘ID’] = $arRes[‘ID’];
$arItem[‘BRAND’][‘UF_NAME’] = $arRes[‘UF_NAME’];
}

<? echo $arItem[‘BRAND’][‘UF_NAME’];?>

Tags :