Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Registrar.php
1<?php
2
4
10
12{
13 protected string $channelType = ChannelType::SMS;
14
16 {
17 parent::__construct($providerId, $optionManager, $utils);
18 if ($this->isRegistered() && !$this->isMigratedToStandartSettingNames())
19 {
20 $this->migrateToStandartSettingNames();
21 }
22 }
23
24 protected function getCallbackTypeList(): array
25 {
26 return [
28 ];
29 }
30
31 private function isMigratedToStandartSettingNames(): bool
32 {
33 return $this->optionManager->getOption(InternalOption::MIGRATED_TO_STANDART_SETTING_NAMES, 'N') === 'Y';
34 }
35
36 private function migrateToStandartSettingNames(): void
37 {
38 $options = $this->optionManager->getOptions();
39 if (isset($options['apiKey']))
40 {
41 $migratedOptions = [
42 InternalOption::API_KEY => $options['apiKey'],
43 InternalOption::MIGRATED_TO_STANDART_SETTING_NAMES => 'Y'
44 ];
45
46 $this->optionManager->setOptions($migratedOptions);
47 }
48 }
49}
__construct(string $providerId, OptionManager $optionManager, EdnaRu $utils)
Definition Registrar.php:15