Skip to content

Instantly share code, notes, and snippets.

@s2ar
Last active November 11, 2016 07:11
Show Gist options
  • Save s2ar/9200723392cbf1382a90 to your computer and use it in GitHub Desktop.
Save s2ar/9200723392cbf1382a90 to your computer and use it in GitHub Desktop.
bitrix highloadblock all items
<?php
// Взято с http://thisis-blog.ru/elementi-highload-bloka/#compl
// подключаем пространство имен класса HighloadBlockTable и даём ему псевдоним HLBT для удобной работы
use Bitrix\Highloadblock\HighloadBlockTable as HLBT;
//подключаем модуль highloadblock
CModule::IncludeModule('highloadblock');
//Напишем функцию получения экземпляра класса:
function GetEntityDataClass($HlBlockId) {
if (empty($HlBlockId) || $HlBlockId < 1) return false;
$hlblock = HLBT::getById($HlBlockId)->fetch();
$entity = HLBT::compileEntity($hlblock);
$entity_data_class = $entity->getDataClass();
return $entity_data_class;
}
CModule::IncludeModule('highloadblock');
$entity_data_class = GetEntityDataClass(MY_HL_BLOCK_ID);
$rsData = $entity_data_class::getList(array(
'select' => array('*')
));
while($el = $rsData->fetch()){
print_r($el);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment