Você não pode selecionar mais de 25 tópicos
Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
|
- <?php
-
- namespace domain\Setting;
-
- use domain\Setting\SettingDetails\Admin\AdminSettingDefinition;
- use domain\_\AbstractManager;
-
- class SettingImporter extends AbstractManager
- {
- protected AdminSettingDefinition $adminSettingDefinition;
- protected SettingBuilder $settingBuilder;
-
- public function loadDependencies(): void
- {
- $this->adminSettingDefinition = $this->loadService(AdminSettingDefinition::class);
- $this->settingBuilder = $this->loadService(SettingBuilder::class);
- }
-
- public function importFromDefinitions()
- {
- $this->importFromAdminSettingDefinition();
- $this->importFromProducerSettingDefinition();
- }
-
- public function importFromAdminSettingDefinition(): void
- {
- \Yii::$app->logic->setProducerContext(null);
- foreach ($this->adminSettingDefinition->getSettingDetailsFlat() as $settingDetail) {
- $this->settingBuilder->createSetting($settingDetail->getName());
- }
- }
-
- public function importFromProducerSettingDefinition(): void
- {
- // /!\ bien définir le contexte producteur
- }
- }
|