Answer the question
In order to leave comments, you need to log in
How to fill an array with the result of a while loop?
<? if (!CModule::IncludeModule('highloadblock')) continue;
$ID = 2;
$hldata = Bitrix\Highloadblock\HighloadBlockTable::getById($ID)->fetch();
$hlentity = Bitrix\Highloadblock\HighloadBlockTable::compileEntity($hldata);
$hlDataClass = $hldata['NAME'].'Table';
$arResult['CUSTOM'] = [];
$arFilter = Array(
Array(
"LOGIC"=>"AND",
Array(
'UF_XML_ID'=> $arItem['PROPERTIES']['YEAR']['VALUE']
)
)
);
$result = $hlDataClass::getList(array(
'select' => array('ID', 'UF_NAME', 'UF_XML_ID'),
'order' => array('UF_XML_ID' =>'ASC'),
'filter' => $arFilter,
));
while ($res = $result->fetch()) {
print_r($res);
}
?>
Answer the question
In order to leave comments, you need to log in
<? if (!CModule::IncludeModule('highloadblock')) continue;
$ID = 2;
$hldata = Bitrix\Highloadblock\HighloadBlockTable::getById($ID)->fetch();
$hlentity = Bitrix\Highloadblock\HighloadBlockTable::compileEntity($hldata);
$hlDataClass = $hldata['NAME'].'Table';
$arResult['CUSTOM'] = [];
$arFilter = Array(
Array(
"LOGIC"=>"AND",
Array(
'UF_XML_ID'=> $arItem['PROPERTIES']['YEAR']['VALUE']
)
)
);
$result = $hlDataClass::getList(array(
'select' => array('ID', 'UF_NAME', 'UF_XML_ID'),
'order' => array('UF_XML_ID' =>'ASC'),
'filter' => $arFilter,
));
$arReturn = [];
while ($res = $result->fetch()) {
$arReturn[] = $res;
}
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question