• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/history.php
  • Класс: BitrixLandingHistory
  • Вызов: History::deleteStep
protected function deleteStep(int $step): bool
{
	if (!isset($this->stack[$step]))
	{
		return false;
	}

	$item = $this->stack[$step];
	$action = $this->getActionForStep($item['STEP'], false);
	if (!$action || !$action->delete())
	{
		return false;
	}

	if (isset($item['MULTIPLY']) && is_array($item['MULTIPLY']) && !empty($item['MULTIPLY']))
	{
		foreach ($item['MULTIPLY'] as $multyId)
		{
			$resDelete = HistoryTable::delete($multyId);
			if (!$resDelete->isSuccess())
			{
				return false;
			}
		}
	}
	else
	{
		$resDelete = HistoryTable::delete($item['ID']);
		if (!$resDelete->isSuccess())
		{
			return false;
		}
	}

	// update stack and step
	unset($this->stack[$step]);
	$this->resetStackSteps();
	if ($step <= $this->step)
	{
		return $this->saveStep($this->step - 1);
	}

	return true;
}