History::getActionForStep

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

	$stepItem = $this->stack[$step];
	$stepId = $stepItem['ID'];
	$direction = ActionFactory::getDirectionName($undo);
	if (isset($this->actions[$stepId][$direction]))
	{
		return $this->actions[$stepId][$direction];
	}

	$params = $stepItem['ACTION_PARAMS'];
	if ($this->entityType === self::ENTITY_TYPE_LANDING)
	{
		$params['lid'] = $this->entityId;
	}
	if ($this->entityType === self::ENTITY_TYPE_DESIGNER_BLOCK)
	{
		$params['blockId'] = $this->entityId;
	}

	$action = ActionFactory::getAction($stepItem['ACTION'], $undo);
	if (!$action)
	{
		return null;
	}

	$action->setParams($params, true);
	$this->actions[$stepId][$direction] = $action;

	return $action;
}

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