Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
formatservice.php
1
<?php
2
3
namespace
Bitrix\Location\Service
;
4
5
use Bitrix\Location\Common\RepositoryTrait;
6
use \Bitrix\Location\Entity;
7
use
Bitrix\Location\Exception\RuntimeException
;
8
use
Bitrix\Location\Common\BaseService
;
9
use
Bitrix\Location\Infrastructure\Service\Config\Container
;
10
use
Bitrix\Location\Repository\FormatRepository
;
11
19
final
class
FormatService
extends
BaseService
20
{
21
use RepositoryTrait;
22
24
protected
static
$instance
;
25
27
private
$defaultFormatCode;
28
30
protected
$repository
;
31
39
public
function
findByCode
(
string
$formatCode,
string
$languageId)
40
{
41
$result =
false
;
42
43
try
44
{
45
$result = $this->repository->findByCode($formatCode, $languageId);
46
}
47
catch
(
RuntimeException
$exception)
48
{
49
$this->
processException
($exception);
50
}
51
52
return
$result;
53
}
54
61
public
function
findAll
(
string
$languageId)
62
{
63
$result =
false
;
64
65
try
66
{
67
$result = $this->repository->findAll($languageId);
68
}
69
catch
(
RuntimeException
$exception)
70
{
71
$this->
processException
($exception);
72
}
73
74
return
$result;
75
}
76
83
public
function
findDefault
(
string
$languageId)
84
{
85
$result =
false
;
86
87
try
88
{
89
$result = $this->repository
90
->findByCode($this->defaultFormatCode, $languageId);
91
92
}
93
catch
(
RuntimeException
$exception)
94
{
95
$this->
processException
($exception);
96
}
97
98
return
$result;
99
}
100
106
public
function
getDefaultFormatCode
(): string
107
{
108
return
$this->defaultFormatCode;
109
}
110
115
public
function
setDefaultFormatCode
($defaultFormatCode)
116
{
117
$this->defaultFormatCode = $defaultFormatCode;
118
return
$this;
119
}
120
125
protected
function
__construct
(
Container
$config)
126
{
127
parent::__construct($config);
128
$this->defaultFormatCode = $config->
get
(
'defaultFormatCode'
);
129
$this->setRepository($config->
get
(
'repository'
));
130
}
131
}
Bitrix\Location\Common\BaseService
Definition
baseservice.php:12
Bitrix\Location\Common\BaseService\processException
processException(\Exception $exception)
Definition
baseservice.php:39
Bitrix\Location\Exception\RuntimeException
Definition
runtimeexception.php:6
Bitrix\Location\Infrastructure\Service\Config\Container
Definition
container.php:8
Bitrix\Location\Infrastructure\Service\Config\Container\get
get($id)
Definition
container.php:16
Bitrix\Location\Repository\FormatRepository
Definition
formatrepository.php:14
Bitrix\Location\Service\FormatService
Definition
formatservice.php:20
Bitrix\Location\Service\FormatService\$repository
$repository
Definition
formatservice.php:30
Bitrix\Location\Service\FormatService\findByCode
findByCode(string $formatCode, string $languageId)
Definition
formatservice.php:39
Bitrix\Location\Service\FormatService\__construct
__construct(Container $config)
Definition
formatservice.php:125
Bitrix\Location\Service\FormatService\getDefaultFormatCode
getDefaultFormatCode()
Definition
formatservice.php:106
Bitrix\Location\Service\FormatService\findDefault
findDefault(string $languageId)
Definition
formatservice.php:83
Bitrix\Location\Service\FormatService\setDefaultFormatCode
setDefaultFormatCode($defaultFormatCode)
Definition
formatservice.php:115
Bitrix\Location\Service\FormatService\findAll
findAll(string $languageId)
Definition
formatservice.php:61
Bitrix\Location\Service\FormatService\$instance
static $instance
Definition
formatservice.php:24
Bitrix\Location\Service
Definition
addressservice.php:3
modules
location
lib
service
formatservice.php
Создано системой
1.10.0