Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
configfactory.php
1<?php
2
4
8
10{
11 protected $frontendKey;
12 protected $backendKey;
13
14 public function __construct(string $frontendKey, string $backendKey)
15 {
16 $this->frontendKey = $frontendKey;
17 $this->backendKey = $backendKey;
18 }
19
20 public function createConfig(): Config
21 {
22 $sourceConfig = new Config();
23 $sourceConfig->addItem(
24 (new ConfigItem('API_KEY_FRONTEND', 'string'))
25 ->setSort(10)
26 ->setValue($this->frontendKey)
27 )
28 ->addItem(
29 (new ConfigItem('API_KEY_BACKEND', 'string'))
30 ->setSort(20)
31 ->setValue($this->backendKey)
32 )
33 ->addItem(
34 (new ConfigItem('SHOW_PHOTOS_ON_MAP', 'bool'))
35 ->setSort(30)
36 ->setValue(false)
37 )
38 ->addItem(
39 (new ConfigItem('USE_GEOCODING_SERVICE', 'bool'))
40 ->setSort(40)
41 ->setValue(false)
42 )
43 ;
44
45 return $sourceConfig;
46 }
47}
__construct(string $frontendKey, string $backendKey)