A
A
Andrey Eskov2018-05-07 18:21:04
1C-Bitrix
Andrey Eskov, 2018-05-07 18:21:04

How to get data from Highload block?

Dear, tell me how you can get all the data from the Highload block.
There is a product, the product has the "Directory" property. So now the problem is how to get all the data of the selected property.
There is this data

["PROPERTIES"]=>
    ["MANUFACTURER"]=>array(34) { 
        ["ID"]=>string(1) "4"
        ["IBLOCK_ID"]=>string(1) "1"
        ["NAME"]=>string(26) "Производитель"
      ["ACTIVE"]=>string(1) "Y"
      ["SORT"]=>string(1) "2"
      ["CODE"]=>string(12) "MANUFACTURER"
      ["DEFAULT_VALUE"]=>string(0) ""
      ["PROPERTY_TYPE"]=>string(1) "S"
      ["ROW_COUNT"]=>string(1) "1"
      ["COL_COUNT"]=>string(2) "30"
      ["LIST_TYPE"]=>string(1) "L"
      ["MULTIPLE"]=>string(1) "N"
      ["XML_ID"]=>NULL
      ["FILE_TYPE"]=>string(0) ""
      ["MULTIPLE_CNT"]=>string(1) "5"
      ["LINK_IBLOCK_ID"]=>string(1) "0"
      ["WITH_DESCRIPTION"]=>string(1) "N"
      ["SEARCHABLE"]=>string(1) "N"
      ["FILTRABLE"]=>string(1) "N"
      ["IS_REQUIRED"]=>tring(1) "Y"
      ["VERSION"]=>tring(1) "2"
      ["USER_TYPE"]=>string(9) "directory"
      ["USER_TYPE_SETTINGS"]=>array(5) {
          ["size"]=>int(1)
          ["width"]=>int(0)
          ["group"]=>string(1) "N"
          ["multiple"]=>string(1) "N"
          ["TABLE_NAME"]=>string(19) "b_hlbd_manufacturer"
      }
      ["HINT"]=>string(0) ""
      ["~NAME"]=>string(26) "Производитель"
      ["~DEFAULT_VALUE"]=>string(0) ""
      ["VALUE_ENUM"]=>string(0) ""
      ["VALUE_XML_ID"]=>NULL
      ["VALUE_SORT"]=>NULL
      ["VALUE"]=>string(7) "cattani"
      ["PROPERTY_VALUE_ID"]=>string(3) "7:4"
      ["DESCRIPTION"]=>NULL
      ["~VALUE"]=>string(7) "cattani"
      ["~DESCRIPTION"]=>NULL
    }

This data does not contain pictures, descriptions, and so on, tell me how you can get all the data.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasya, 2018-05-07
@taurus2790

something like this, I'm too lazy to launch myself, sorry :)

$tableName = "b_hlbd_manufacturer";
    $hlblock = \Bitrix\Highloadblock\HighloadBlockTable::getList(
        array("filter" => array(
            'TABLE_NAME' => $tableName
        ))
    )->fetch();
    if (isset($hlblock['ID']))
    {
        $entity = \Bitrix\Highloadblock\HighloadBlockTable::compileEntity($hlblock);
        $entity_data_class = $entity->getDataClass();
        $res = $entity_data_class::getList( array('filter'=>array()) );
         while ($item = $res->fetch()
         {
                // .... la .. la .. la
         }
         // или так $arAllRows = $res->fetchAll();
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question