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

	LandingLanding::setEditMode(true);

	if (in_array($entityType, LandingHistory::AVAILABLE_TYPES))
	{
		$history = new LandingHistory($entityId, $entityType);
		if ($history->push($action, $data))
		{
			$result->setResult(true);
		}
		else
		{
			$error->addError(
				'HISTORY_PUSH_ERROR',
				"History operation Push fail for entity {$entityType}_{$entityId}"
			);
			$result->setError($error);
		}
	}
	else
	{
		$error->addError(
			'HISTORY_WRONG_TYPE',
			'Wrong history entity type'
		);
		$result->setError($error);
	}

	return $result;
}