• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/subtype/search.php
  • Класс: BitrixLandingSubtypeSearch
  • Вызов: Search::getSearchResultPage
static function getSearchResultPage($siteId, $tplCode)
{
	$siteId = (int) $siteId;
	$tplCode = (string) $tplCode;

	$res = Landing::getList([
		'select' => [
			'ID'
		],
		'filter' => [
			'SITE_ID' => $siteId,
			'=TPL_CODE' => $tplCode
		]
	]);
	if ($row = $res->fetch())
	{
		$landingId = $row['ID'];
	}
	else
	{
		$res = BitrixLandingPublicActionLanding::addByTemplate(
			$siteId,
			$tplCode
		);
		$landingId = $res->getResult();
	}

	return $landingId;
}