History::clearBefore

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

	// if first step - can't delete nothing
	if ($this->step <= 1)
	{
		return true;
	}

	// delete only before current step
	if ($step >= $this->step)
	{
		$step = $this->step - 1;
	}

	for ($i = 1; $i <= $step; $i++)
	{
		if (!$this->deleteStep(1))
		{
			return false;
		}
	}

	return true;
}

Добавить комментарий