getParentThemes example

if (empty($themeData['id'])) {
            $themeData['id'] = current($writtenEvent->getPrimaryKeys(ThemeDefinition::ENTITY_NAME));
        }

        $this->themeRepository->upsert([$themeData]$context);

        if (!empty($themeData['toDeleteMedia'])) {
            $this->themeMediaRepository->delete($themeData['toDeleteMedia']$context);
        }

        $parentThemes = $this->getParentThemes($configuration$themeData['id']);
        $parentCriteria = new Criteria();
        $parentCriteria->addFilter(new EqualsFilter('childId', $themeData['id']));
        /** @var list<array<string, string>> $toDeleteIds */
        $toDeleteIds = $this->themeChildRepository->searchIds($parentCriteria$context)->getIds();
        $this->themeChildRepository->delete($toDeleteIds$context);
        $this->themeChildRepository->upsert($parentThemes$context);
    }

    public function removeTheme(string $technicalName, Context $context): void
    {
        $criteria = new Criteria();
        
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() ?? []);
            }
        }

        $configuredTheme = $this->mergeStaticConfig($theme);
        $themeConfig = array_replace_recursive($baseThemeConfig$configuredTheme);

        foreach ($themeConfig['fields'] ?? [] as $name => $item) {
            
Home | Imprint | This part of the site doesn't use cookies.