Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
shopsitescontroller.php
1<?php
2
3namespace Bitrix\Sale;
4
5abstract class ShopSitesController
6{
7 public static function getShops(): array
8 {
9 static $shops = null;
10 if (is_array($shops))
11 {
12 return $shops;
13 }
14
15 $shops = [];
16 $siteIterator = \Bitrix\Main\SiteTable::getList([
17 'select' => ['LID', 'NAME', 'SORT'],
18 'order' => ['SORT' => 'ASC'],
19 'cache' => ['ttl' => 86400],
20 ]);
21 while ($site = $siteIterator->fetch())
22 {
23 $saleSite = \Bitrix\Main\Config\Option::get('sale', 'SHOP_SITE_'.$site['LID']);
24 if ($site['LID'] === $saleSite)
25 {
26 $shops[] = $site;
27 }
28 }
29
30 return $shops;
31 }
32}