R
R
Ruslan Absalyamov2018-06-18 15:12:30
1C-Bitrix
Ruslan Absalyamov, 2018-06-18 15:12:30

Why can't getList work for me?

I'm trying to use GetList, but I can't display the required infoblocks, I don't know why

CModule::IncludeModule('highloadblock');

$bWholesale = in_array($USER::WHOLESALE, $USER->GetUserGroupArray());
$wholesale = $bWholesale ? 'true' : 'false';
$hlblock = HighloadBlockTable::getById(HighloadBlockTable::TRANSPORT)->fetch();
$enity = HighloadBlockTable::compileEntity($hlblock);
$entityClass = $enity->getDataClass();

$res = $entityClass::getList(array(
    'select' => array('UF_NAME'),
    'filter' => array('UF_ACTIVE' => 1)
));
while($row = $res->fetch()){
    $arResult['listCompany'] = $row['UF_NAME'];
}

$hlblock outputs
array (size=3)
  'ID' => string '1' (length=1)
  'NAME' => string 'Transpot' (length=8)
  'TABLE_NAME' => string 'b_transport_company' (length=19)

Although there are records there, I make a sql query and I get
SELECT UF_NAME
FROM `b_transport_company`
WHERE UF_ACTIVE = 1

Why can't I display false instead of displaying all records?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-06-19
@rusline18

output $arResult

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question