• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/History/Action/ReplaceLanding.php
  • Класс: BitrixLandingHistoryActionReplaceLanding
  • Вызов: ReplaceLanding::delete
public function delete(): bool
{
	if (!isset($this->params['blocksBefore']))
	{
		return false;
	}

	$blocks = $this->params['blocksBefore'];

	if (!empty($blocks))
	{
		$query = BlockTable::query()
			->setSelect(['ID', 'ACCESS'])
			->whereIn('ID', $blocks)
			->where('DELETED', '=', 'Y')
			->exec()
		;
		while ($block = $query->fetch())
		{
			if ($block['ACCESS'] === Block::ACCESS_X)
			{
				$blockId = (int)$block['ID'];
				BlockTable::delete($blockId);
				File::deleteFromBlock($blockId);
			}
		}
	}

	return parent::delete();
}