1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
address.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Location\Controller
;
4
5
use
Bitrix\Location\Entity\Address\Converter\ArrayConverter
;
6
use
Bitrix\Location\Infrastructure\Service\ErrorService
;
7
use
Bitrix\Location\Service
;
8
14
class
Address
extends
\Bitrix\Main\Engine\Controller
15
{
16
protected
function
init
()
17
{
18
parent::init();
19
ErrorService::getInstance()->setThrowExceptionOnError(
true
);
20
}
21
22
protected
function
getDefaultPreFilters
()
23
{
24
return
[];
25
}
26
34
public
function
findById
(
int
$addressId):
array
35
{
36
$result
=
null
;
37
38
if
($address =
Service
\
AddressService::getInstance
()->
findById
($addressId))
39
{
40
$result
= ArrayConverter::convertToArray($address);
41
}
42
43
return
$result
;
44
}
45
50
protected
function
createArrayFromAddressCollection
(
array
$collection):
array
51
{
52
$result
= [];
53
54
foreach
($collection as $address)
55
{
56
$result
[] = ArrayConverter::convertToArray($address);
57
}
58
59
return
$result
;
60
}
61
66
public
static
function
saveAction
(
array
$address):
array
67
{
68
$entity
= ArrayConverter::convertFromArray($address);
69
$result
=
$entity
->save();
70
71
return
[
72
'isSuccess'
=>
$result
->isSuccess(),
73
'errors'
=>
$result
->getErrorMessages(),
74
'address'
=> ArrayConverter::convertToArray(
$entity
)
75
];
76
}
77
83
public
function
deleteAction
(
int
$addressId): \
Bitrix
\
Main
\
ORM
\
Data
\
DeleteResult
84
{
85
return
Service\AddressService::getInstance
()->delete($addressId);
86
}
87
}
Bitrix\Location\Common\BaseService\getInstance
static getInstance()
Определения
baseservice.php:21
Bitrix\Location\Controller\Address\getDefaultPreFilters
getDefaultPreFilters()
Определения
address.php:22
Bitrix\Location\Controller\Address\init
init()
Определения
address.php:16
Bitrix\Location\Controller\Address\deleteAction
deleteAction(int $addressId)
Определения
address.php:83
Bitrix\Location\Controller\Address\findById
findById(int $addressId)
Определения
address.php:34
Bitrix\Location\Controller\Address\saveAction
static saveAction(array $address)
Определения
address.php:66
Bitrix\Location\Controller\Address\createArrayFromAddressCollection
createArrayFromAddressCollection(array $collection)
Определения
address.php:50
Bitrix\Location\Entity\Address\Converter\ArrayConverter
Определения
arrayconverter.php:14
Bitrix\Location\Infrastructure\Service\ErrorService
Определения
errorservice.php:21
Bitrix\Main\ORM\Data\DeleteResult
Определения
deleteresult.php:12
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
$entity
$entity
Определения
group_bizproc_workflow_delete.php:17
Bitrix\Location\Controller
Определения
address.php:3
Bitrix\Location\Entity\Address
Определения
addresscollection.php:3
Bitrix\Location\Service
Определения
addressservice.php:3
Bitrix\Main\Controller
Определения
agreement.php:2
Bitrix\Main\Data
Определения
aliases.php:105
Bitrix\Main\ORM
Bitrix\Main\Service
Bitrix\Main
Bitrix
bitrix
modules
location
lib
controller
address.php
Создано системой
1.14.0