Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
site.php
1<?php
2
4
5class Site
6{
7 private static function canUse(): bool
8 {
9 return \Bitrix\Main\Loader::includeModule('landing');
10 }
11
16 public static function getLandingAndStorePublicUrls(): array
17 {
18 if (!static::canUse())
19 {
20 return [];
21 }
22
23 $siteIds = \Bitrix\Landing\Site::getList([
24 'select' => [
25 'ID',
26 ],
27 'filter' => [
28 '@TYPE' => ['PAGE', 'STORE'],
29 ],
30 ]);
31 $siteIds = array_column($siteIds->fetchAll(), 'ID');
32
33 if (empty($siteIds))
34 {
35 return [];
36 }
37
38 return array_values((array)\Bitrix\Landing\Site::getPublicUrl($siteIds));
39 }
40}