1
0
mirror of synced 2024-11-22 21:36:10 +03:00
bitrix-module/intaro.retailcrm/lib/repository/siterepository.php

30 lines
583 B
PHP
Raw Normal View History

2021-05-31 16:33:02 +03:00
<?php
namespace Intaro\RetailCrm\Repository;
use CSite;
use RetailcrmConfigProvider;
/**
* Class SiteRepository
* @package Intaro\RetailCrm\Repository
*/
class SiteRepository
{
/**
* @return string
*/
public static function getDefaultServerName(): ?string
{
$rsSites = CSite::GetList($by, $sort, ['ACTIVE' => 'Y']);
while ($ar = $rsSites->Fetch()) {
if ($ar['DEF'] === 'Y') {
return RetailcrmConfigProvider::getProtocol() . $ar['SERVER_NAME'];
}
}
return null;
}
}