Nelze vybrat více než 25 témat
Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
|
- <?php
-
- namespace common\logic\Setting;
-
- use common\logic\AbstractManager;
- use common\logic\Setting\SettingDetails\Admin\AdminSettingDefinition;
-
- 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);
- $settingDetails = $this->adminSettingDefinition->getSettingDetails();
-
- foreach($settingDetails as $subsectionsArray) {
- foreach($subsectionsArray as $settingDetailsArray) {
- foreach($settingDetailsArray as $settingDetail) {
- $this->settingBuilder->createSetting($settingDetail->getName());
- }
- }
- }
- }
-
- public function importFromProducerSettingDefinition(): void
- {
- // /!\ bien définir le contexte producteur
- }
- }
|