1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
baseservice.php
См. документацию.
1<?php
2
4
9
10abstract class BaseService
11{
13 protected static $instance;
14
15 public function __clone(){}
16 public function __wakeup(){}
17
21 public static function getInstance()
22 {
23 if (empty(static::$instance))
24 {
25 static::$instance = static::createInstance(
26 static::getConfig(static::class)
27 );
28 }
29
30 return static::$instance;
31 }
32
33 protected static function createInstance(Container $config)
34 {
35 return new static($config);
36 }
37
38 protected function processException(\Exception $exception): void
39 {
40 ErrorService::getInstance()->addError(
41 new Error($exception->getMessage(), $exception->getCode())
42 );
43 }
44
45 protected function __construct(Container $config)
46 {
47 }
48
49 protected static function getConfig(string $class)
50 {
51 return Factory::createConfig($class);
52 }
53}
static getConfig(string $class)
Определения baseservice.php:49
__construct(Container $config)
Определения baseservice.php:45
static createInstance(Container $config)
Определения baseservice.php:33
static getInstance()
Определения baseservice.php:21
processException(\Exception $exception)
Определения baseservice.php:38
Определения error.php:15
$config
Определения quickway.php:69