I
I
Irek Sitdikov2016-06-28 16:39:53
1C-Bitrix
Irek Sitdikov, 2016-06-28 16:39:53

How to remove a HighLoad block using the Bitrix API?

It is necessary to remove the HighLoad block by its name (code). I found the following method, but it is not entirely clear which parameter should be passed:
bxapi.ru/src/?module_id=highloadblock&name=Highloa...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
msk-develop, 2016-07-01
@sitdirek

You need to get the highload block ID first.

use Bitrix\Highloadblock as HL;

$filter = array(
  'select' => array('ID'),
  'filter' => array('=NAME' => "CODE_OF_YOUR_HLBLOCK")
);
$hlblock = HL\HighloadBlockTable::getList($filter)->fetch();
if(is_array($hlblock) && !empty($hlblock))
{
  HL\HighloadBlockTable::delete($hlblock['ID']);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question