Last active
November 11, 2016 07:11
-
-
Save s2ar/9200723392cbf1382a90 to your computer and use it in GitHub Desktop.
bitrix highloadblock all items
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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