• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/publicaction/template.php
  • Класс: BitrixLandingPublicActionTemplate
  • Вызов: Template::refProcess
static function refProcess($id, $type, $method, array $data = array())
{
	$result = new PublicActionResult();
	$error = new BitrixLandingError;
	$data = (array) $data;
	$id = (int)$id;

	if ($type == TemplateRef::ENTITY_TYPE_SITE)
	{
		$entityClass = SiteCore::class;
		$method = $method . 'ForSite';
	}
	else if ($type == TemplateRef::ENTITY_TYPE_LANDING)
	{
		$entityClass = LandingCore::class;
		$method = $method . 'ForLanding';
	}

	if (isset($entityClass))
	{
		$entity = $entityClass::getList(array(
			'select' => array(
				'ID'
			),
			'filter' => array(
				'ID' => $id
			)
		))->fetch();
		if ($entity)
		{
			$res = TemplateRef::$method(
				$id,
				$data
			);
			$result->setResult(
				$res == null ? true : $res
			);
		}
		else
		{
			$error->addError(
				'ENTITY_NOT_FOUND',
				Loc::getMessage('LANDING_ENTITY_NOT_FOUND')
			);
		}
	}

	$result->setError($error);

	return $result;
}