1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
source.php
См. документацию.
1<?php
2
3namespace Bitrix\Location\Entity;
4
5use Bitrix\Location\Entity\Source\Config;
6use Bitrix\Location\Repository\Location\IRepository;
7use Bitrix\Location\StaticMap\ISourceStaticMapService;
8use Bitrix\Main\Context;
9use Bitrix\Main\IO\File;
10use Bitrix\Main\Localization\StreamConverter;
11
17abstract class Source
18{
20 protected $code;
21
23 protected $name;
24
26 protected $isDefault = false;
27
29 protected $config;
30
32 protected $autocompleteReplacements = null;
33
37 public function getCode(): string
38 {
39 return $this->code;
40 }
41
46 public function setCode(string $code): Source
47 {
48 $this->code = $code;
49
50 return $this;
51 }
52
56 public function getName(): ?string
57 {
58 return $this->name;
59 }
60
65 public function setName(string $name): Source
66 {
67 $this->name = $name;
68
69 return $this;
70 }
71
75 public function isDefault(): bool
76 {
77 return $this->isDefault;
78 }
79
80 public function isAvailable(): bool
81 {
82 return true;
83 }
84
88 public function getConfig(): ?Config
89 {
90 return $this->config;
91 }
92
97 public function setConfig(?Config $config): Source
98 {
99 $this->config = $config;
100
101 return $this;
102 }
103
110 public function getAutocompleteReplacements(string $languageId): array
111 {
112 if ($this->autocompleteReplacements === null)
113 {
114 $this->autocompleteReplacements = [];
115
116 $path = Context::getCurrent()->getServer()->getDocumentRoot()
117 . '/bitrix/modules/location/lang/'
118 . $languageId
119 . '/lib/source/'
120 . strtolower($this->code)
121 . '/autocompletereplacements.php';
122
123 if (File::isFileExists($path))
124 {
125 $this->autocompleteReplacements = StreamConverter::include($path, $languageId);
126 }
127 }
128
129 return $this->autocompleteReplacements;
130 }
131
137 abstract public function makeRepository(): IRepository;
138
144 abstract public function makeStaticMapService(): ?ISourceStaticMapService;
145
151 abstract public function getJSParams(): array;
152
157 abstract public function convertLang(string $bitrixLang): string;
158}
$path
Определения access_edit.php:21
setConfig(?Config $config)
Определения source.php:97
$autocompleteReplacements
Определения source.php:32
getAutocompleteReplacements(string $languageId)
Определения source.php:110
setName(string $name)
Определения source.php:65
convertLang(string $bitrixLang)
setCode(string $code)
Определения source.php:46
isAvailable()
Определения source.php:80
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
$name
Определения menu_edit.php:35
$config
Определения quickway.php:69