Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
format.php
1
<?php
2
3
namespace
Bitrix\Location\Controller
;
4
5
use
Bitrix\Location\Infrastructure\Service\ErrorService
;
6
use
Bitrix\Location\Service
;
7
use
Bitrix\Main\Engine\ActionFilter\Cors
;
8
use \Bitrix\Location\Entity;
9
15
class
Format
extends
\Bitrix\Main\Engine\Controller
16
{
17
protected
function
init
()
18
{
19
parent::init();
20
ErrorService::getInstance()->setThrowExceptionOnError(
true
);
21
}
22
23
protected
function
getDefaultPreFilters
()
24
{
25
return
[];
26
}
27
28
public
function
findByCodeAction
(
string
$formatCode,
string
$languageId)
29
{
30
$result = [];
31
32
if
($format = Service\FormatService::getInstance()->findByCode($formatCode, $languageId))
33
{
34
$result = Entity\Format\Converter\ArrayConverter::convertToArray($format);
35
}
36
37
return
$result;
38
}
39
40
public
function
findAllAction
(
string
$languageId)
41
{
42
$result = [];
43
44
foreach
(Service\FormatService::getInstance()->findAll($languageId) as $format)
45
{
46
$result[] = Entity\Format\Converter\ArrayConverter::convertToArray($format);
47
}
48
49
return
$result;
50
}
51
52
public
function
findDefaultAction
(
string
$languageId)
53
{
54
$result =
null
;
55
56
if
($format = Service\FormatService::getInstance()->findDefault($languageId))
57
{
58
$result = Entity\Format\Converter\ArrayConverter::convertToArray($format);
59
}
60
61
return
$result;
62
}
63
}
Bitrix\Location\Controller\Format
Definition
format.php:16
Bitrix\Location\Controller\Format\getDefaultPreFilters
getDefaultPreFilters()
Definition
format.php:23
Bitrix\Location\Controller\Format\findByCodeAction
findByCodeAction(string $formatCode, string $languageId)
Definition
format.php:28
Bitrix\Location\Controller\Format\init
init()
Definition
format.php:17
Bitrix\Location\Controller\Format\findAllAction
findAllAction(string $languageId)
Definition
format.php:40
Bitrix\Location\Controller\Format\findDefaultAction
findDefaultAction(string $languageId)
Definition
format.php:52
Bitrix\Location\Infrastructure\Service\ErrorService
Definition
errorservice.php:21
Bitrix\Main\Engine\ActionFilter\Cors
Definition
cors.php:13
Bitrix\Main\Engine\Controller
Definition
controller.php:32
Bitrix\Location\Controller
Definition
address.php:3
Bitrix\Location\Service
Definition
addressservice.php:3
modules
location
lib
controller
format.php
Создано системой
1.10.0