- Модуль: landing
- Путь к файлу: ~/bitrix/modules/landing/lib/site/update/chatsales.php
- Класс: BitrixLandingSiteUpdateChatSales
- Вызов: ChatSales::setTemplateToLanding
static function setTemplateToLanding(int $landingId, string $templateName, array $templateReferences): bool
{
$resTemplate = Template::getList([
'select' => [
'ID', 'XML_ID',
],
'filter' => [
'XML_ID' => $templateName,
],
]);
if ($template = $resTemplate->fetch())
{
$resUpdate = Landing::update($landingId, [
'TPL_ID' => $template['ID'],
]);
if ($resUpdate->isSuccess())
{
TemplateRef::setForLanding($landingId, $templateReferences);
return true;
}
}
return false;
}