- Модуль: landing
- Путь к файлу: ~/bitrix/modules/landing/lib/update/block.php
- Класс: BitrixLandingUpdateBlock
- Вызов: Block::register
static function register($codes, array $params = [])
{
if (!is_array($codes))
{
$codes = [$codes];
}
$res = UpdateBlock::getList([
'select' => [
'ID', 'CODE'
],
'filter' => [
'=CODE' => $codes
]
]);
while ($row = $res->fetch())
{
UpdateBlock::update($row['ID'], [
'LAST_BLOCK_ID' => 0,
'PARAMS' => $params
]);
$codes = array_diff($codes, [$row['CODE']]);
}
if (!empty($codes))
{
foreach ($codes as $code)
{
UpdateBlock::add([
'CODE' => $code,
'PARAMS' => $params
]);
}
}
// reg stepper
BitrixMainUpdateStepper::bindClass(
'BitrixLandingUpdateBlock', 'landing', 600
);
}