Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
addressservice.php
1
<?php
2
3
namespace
Bitrix\Location\Service
;
4
5
use
Bitrix\Location\Common\BaseService
;
6
use Bitrix\Location\Common\RepositoryTrait;
7
use
Bitrix\Location\Entity
;
8
use
Bitrix\Location\Exception\RuntimeException
;
9
use
Bitrix\Location\Infrastructure\Service\Config\Container
;
10
use
Bitrix\Location\Repository\AddressRepository
;
11
use
Bitrix\Main\Localization\Loc
;
12
13
Loc::loadMessages
(__FILE__);
14
22
final
class
AddressService
extends
BaseService
23
{
24
use RepositoryTrait;
25
27
protected
static
$instance
;
28
30
protected
$repository
;
31
38
public
function
findById
(
int
$addressId)
39
{
40
$result =
false
;
41
42
try
43
{
44
$result = $this->repository->findById($addressId);
45
}
46
catch
(
RuntimeException
$exception)
47
{
48
$this->
processException
($exception);
49
}
50
51
return
$result;
52
}
53
61
public
function
findByLinkedEntity
(
string
$entityId,
string
$entityType):
Entity
\
Address
\
AddressCollection
62
{
63
$result =
false
;
64
65
try
66
{
67
$result = $this->repository->findByLinkedEntity($entityId, $entityType);
68
}
69
catch
(
RuntimeException
$exception)
70
{
71
$this->
processException
($exception);
72
}
73
74
return
$result;
75
}
76
83
public
function
save
(
Entity
\
Address
$address)
84
{
85
return
$this->repository->save($address);
86
}
87
94
public
function
delete
(
int
$addressId): \
Bitrix
\Main\ORM\Data\
DeleteResult
95
{
96
return
$this->repository->delete($addressId);
97
}
98
105
public
function
isLimitReached
(): bool
106
{
107
return
false
;
108
}
109
114
protected
function
__construct
(
Container
$config)
115
{
116
$this->setRepository($config->
get
(
'repository'
));
117
parent::__construct($config);
118
}
119
}
Bitrix\Location\Common\BaseService
Definition
baseservice.php:12
Bitrix\Location\Common\BaseService\processException
processException(\Exception $exception)
Definition
baseservice.php:39
Bitrix\Location\Entity\Address\AddressCollection
Definition
addresscollection.php:14
Bitrix\Location\Entity\Address
Definition
address.php:22
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\AddressRepository
Definition
addressrepository.php:15
Bitrix\Location\Service\AddressService
Definition
addressservice.php:23
Bitrix\Location\Service\AddressService\$repository
$repository
Definition
addressservice.php:30
Bitrix\Location\Service\AddressService\__construct
__construct(Container $config)
Definition
addressservice.php:114
Bitrix\Location\Service\AddressService\findByLinkedEntity
findByLinkedEntity(string $entityId, string $entityType)
Definition
addressservice.php:61
Bitrix\Location\Service\AddressService\findById
findById(int $addressId)
Definition
addressservice.php:38
Bitrix\Location\Service\AddressService\isLimitReached
isLimitReached()
Definition
addressservice.php:105
Bitrix\Location\Service\AddressService\save
save(Entity\Address $address)
Definition
addressservice.php:83
Bitrix\Location\Service\AddressService\$instance
static $instance
Definition
addressservice.php:27
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\ORM\Data\DeleteResult
Definition
deleteresult.php:12
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Location\Entity
Definition
address.php:3
Bitrix\Location\Service
Definition
addressservice.php:3
Bitrix
modules
location
lib
service
addressservice.php
Создано системой
1.10.0