1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
Container.php
См. документацию.
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
Bitrix\Rest\Repository;
6
7
use Bitrix\Main\DI\ServiceLocator;
8
use Bitrix\Main\ObjectNotFoundException;
9
use Psr\Container\NotFoundExceptionInterface;
10
11
class
Container
12
{
13
private
static
Container
$instance;
14
private
ServiceLocator
$serviceLocator;
15
private
string
$prefix;
16
17
private
function
__construct()
18
{
19
$this->serviceLocator = ServiceLocator::getInstance();
20
$this->prefix =
'rest.repository.'
;
21
}
22
23
private
function
__clone()
24
{}
25
26
public
static
function
getInstance
(): self
27
{
28
if
(!isset(self::$instance))
29
{
30
self::$instance =
new
self
();
31
}
32
33
return
self::$instance;
34
}
35
36
public
function
has
(
string
$id): bool
37
{
38
return
$this->serviceLocator->has($this->prefix . $id);
39
}
40
45
public
function
get
(
string
$id): mixed
46
{
47
return
$this->serviceLocator->get($this->prefix . $id);
48
}
49
50
public
function
getApplicationRepository
():
AppRepository
51
{
52
return
$this->
get
(
'app'
);
53
}
54
55
public
function
getIntegrationRepository
():
IntegrationRepository
56
{
57
return
$this->
get
(
'integration'
);
58
}
59
}
Bitrix\Main\DI\ServiceLocator
Определения
servicelocator.php:19
Bitrix\Rest\Repository\AppRepository
Определения
AppRepository.php:12
Bitrix\Rest\Repository\Container
Определения
Container.php:12
Bitrix\Rest\Repository\Container\getIntegrationRepository
getIntegrationRepository()
Определения
Container.php:55
Bitrix\Rest\Repository\Container\getApplicationRepository
getApplicationRepository()
Определения
Container.php:50
Bitrix\Rest\Repository\Container\has
has(string $id)
Определения
Container.php:36
Bitrix\Rest\Repository\Container\getInstance
static getInstance()
Определения
Container.php:26
Bitrix\Rest\Repository\IntegrationRepository
Определения
IntegrationRepository.php:14
bitrix
modules
rest
lib
Repository
Container.php
Создано системой
1.14.0