Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
format.php
1<?php
2
4
8use \Bitrix\Location\Entity;
9
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}
findByCodeAction(string $formatCode, string $languageId)
Definition format.php:28
findAllAction(string $languageId)
Definition format.php:40
findDefaultAction(string $languageId)
Definition format.php:52