- Модуль: landing
- Путь к файлу: ~/bitrix/modules/landing/lib/block.php
- Класс: BitrixLandingBlock
- Вызов: Block::getNormalizedBlock
static function getNormalizedBlock(string $code): ?array
{
static $cached = [];
if (isset($cached[$code]))
{
return $cached[$code];
}
$codeOriginal = $code;
[$code, $blockId] = explode('@', $code);
$filter = [
'LID' => 0,
'=DELETED' => 'N',
'=CODE' => $code
];
if ($blockId)
{
$filter['ID'] = $blockId;
}
$res = InternalsBlockTable::getList([
'select' => [
'ID', 'CODE', 'CONTENT', 'SOURCE_PARAMS', 'DESIGNED'
],
'filter' => $filter
]);
if ($row = $res->fetch())
{
$cached[$codeOriginal] = $row;
$cached[$codeOriginal]['FILES'] = File::getFilesFromBlockContent($row['ID'], $row['CONTENT']);
}
return $cached[$codeOriginal] ?? null;
}