ThemeConfigFieldFactory example

if ($theme === null) {
            throw new InvalidThemeException($themeId);
        }

        $baseTheme = $themes->filter(fn (ThemeEntity $themeEntry) => $themeEntry->getTechnicalName() === StorefrontPluginRegistry::BASE_THEME_NAME)->first();
        if ($baseTheme === null) {
            throw new InvalidThemeException(StorefrontPluginRegistry::BASE_THEME_NAME);
        }

        $baseThemeConfig = $this->mergeStaticConfig($baseTheme);

        $themeConfigFieldFactory = new ThemeConfigFieldFactory();
        $configFields = [];
        $labels = array_replace_recursive($baseTheme->getLabels() ?? []$theme->getLabels() ?? []);
        $helpTexts = array_replace_recursive($baseTheme->getHelpTexts() ?? []$theme->getHelpTexts() ?? []);

        if ($theme->getParentThemeId()) {
            foreach ($this->getParentThemes($themes$theme) as $parentTheme) {
                $configuredParentTheme = $this->mergeStaticConfig($parentTheme);
                $baseThemeConfig = array_replace_recursive($baseThemeConfig$configuredParentTheme);
                $labels = array_replace_recursive($labels$parentTheme->getLabels() ?? []);
                $helpTexts = array_replace_recursive($helpTexts$parentTheme->getHelpTexts() ?? []);
            }
        }
Home | Imprint | This part of the site doesn't use cookies.