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 } }