Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
baseservice.php
1
<?php
2
3
namespace
Bitrix\Location\Common
;
4
5
use
Bitrix\Location\Exception\RuntimeException
;
6
use
Bitrix\Location\Infrastructure\Service\Config\Container
;
7
use
Bitrix\Location\Infrastructure\Service\Config\Factory
;
8
use
Bitrix\Location\Infrastructure\Service\ErrorService
;
9
use
Bitrix\Main\Error
;
10
11
abstract
class
BaseService
12
{
14
protected
static
$instance
;
15
16
public
function
__clone
(){}
17
public
function
__wakeup
(){}
18
22
public
static
function
getInstance
()
23
{
24
if
(empty(static::$instance))
25
{
26
static::$instance = static::createInstance(
27
static::getConfig(static::class)
28
);
29
}
30
31
return
static::$instance;
32
}
33
34
protected
static
function
createInstance
(
Container
$config)
35
{
36
return
new
static
($config);
37
}
38
39
protected
function
processException
(\
Exception
$exception): void
40
{
41
ErrorService::getInstance
()->addError(
42
new
Error
($exception->getMessage(), $exception->getCode())
43
);
44
}
45
46
protected
function
__construct
(
Container
$config)
47
{
48
}
49
50
protected
static
function
getConfig
(
string
$class)
51
{
52
return
Factory::createConfig
($class);
53
}
54
}
Bitrix\Location\Common\BaseService
Definition
baseservice.php:12
Bitrix\Location\Common\BaseService\getConfig
static getConfig(string $class)
Definition
baseservice.php:50
Bitrix\Location\Common\BaseService\__construct
__construct(Container $config)
Definition
baseservice.php:46
Bitrix\Location\Common\BaseService\__wakeup
__wakeup()
Definition
baseservice.php:17
Bitrix\Location\Common\BaseService\createInstance
static createInstance(Container $config)
Definition
baseservice.php:34
Bitrix\Location\Common\BaseService\getInstance
static getInstance()
Definition
baseservice.php:22
Bitrix\Location\Common\BaseService\__clone
__clone()
Definition
baseservice.php:16
Bitrix\Location\Common\BaseService\$instance
static $instance
Definition
baseservice.php:14
Bitrix\Location\Common\BaseService\processException
processException(\Exception $exception)
Definition
baseservice.php:39
Bitrix\Location\Entity\Source\Factory
Definition
factory.php:16
Bitrix\Location\Exception\RuntimeException
Definition
runtimeexception.php:6
Bitrix\Location\Infrastructure\Service\Config\Container
Definition
container.php:8
Bitrix\Location\Infrastructure\Service\Config\Factory\createConfig
static createConfig(string $serviceType)
Definition
factory.php:36
Bitrix\Location\Infrastructure\Service\ErrorService
Definition
errorservice.php:21
Bitrix\Main\DB\Exception
Definition
exception.php:11
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Location\Common
Definition
baseservice.php:3
modules
location
lib
common
baseservice.php
Создано системой
1.10.0