getDataClass(); } /** * @param int $HlBlockId * * @return \Bitrix\Main\Entity\Base|null * @throws \Bitrix\Main\ArgumentException * @throws \Bitrix\Main\LoaderException * @throws \Bitrix\Main\ObjectPropertyException * @throws \Bitrix\Main\SystemException */ public static function getBaseEntityByHlId(int $HlBlockId): ?Base { Loader::includeModule('highloadblock'); $hlblock = Highloadblock\HighloadBlockTable::getById($HlBlockId)->fetch(); if (!$hlblock) { return null; } return Highloadblock\HighloadBlockTable::compileEntity($hlblock); } /** * @param string|null $tableName * * @return \Bitrix\Main\Entity\Base|null */ public static function getBaseEntityByTableName(?string $tableName): ?Base { if (!$tableName) { return null; } try { Loader::includeModule('highloadblock'); $hlblock = Highloadblock\HighloadBlockTable::query() ->addSelect('*') ->where('TABLE_NAME', '=', $tableName) ->exec() ->fetch(); if (!$hlblock) { return null; } return Highloadblock\HighloadBlockTable::compileEntity($hlblock); } catch (ObjectPropertyException | ArgumentException | SystemException | LoaderException $exception) { AddMessage2Log($exception->getMessage()); return null; } } /** * Получение DataManager класса управления HLBlock по названию таблицы * * @param string $name * @return \Bitrix\Main\Entity\DataManager|null|string */ public static function getHlClassByTableName(string $name) { $entity = self::getBaseEntityByTableName($name); if ($entity instanceof Base) { return $entity->getDataClass(); } return null; } }