History::clearAfter

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

	// if last step - can't delete nothing
	$stackCount = $this->getStackCount();
	if ($this->step >= $stackCount)
	{
		return true;
	}

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

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

	return true;
}

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