• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/publicaction/history.php
  • Класс: BitrixLandingPublicActionHistory
  • Вызов: History::redoForEntity
static function redoForEntity(string $entityType, int $entityId): PublicActionResult
{
	$result = new PublicActionResult();
	$error = new BitrixLandingError;

	LandingLanding::setEditMode(true);

	if (in_array($entityType, LandingHistory::AVAILABLE_TYPES))
	{
		$history = new LandingHistory($entityId, $entityType);
		$command = $history->getJsCommand(false);
		if ($history->redo())
		{
			$result->setResult($command);
		}
		else
		{
			$error->addError(
				'HISTORY_REDO_ERROR',
				"History operation Redo fail for entity {$entityType}_{$entityId}"
			);
			$result->setError($error);
		}
	}
	else
	{
		$error->addError(
			'HISTORY_WRONG_TYPE',
			'Wrong history entity type'
		);
		$result->setError($error);
	}

	return $result;
}