useInheritanceConfig example

foreach ($themes as &$theme) {
            $theme = $this->translateThemeData($theme$namespace);

            foreach ($theme['configSets'] as &$set) {
                $set = $this->translateConfigSet($set$namespace);
            }
        }

        $instance = $this->util->getThemeByTemplate($template);

        if ($template->getParent() instanceof Template && $instance->useInheritanceConfig()) {
            $themes = array_merge(
                $themes,
                $this->getConfigSets(
                    $template->getParent()
                )
            );
        }

        return $themes;
    }

    

    private function hasTemplateConfigSet(Template $template): bool
    {
        $theme = $this->get(Util::class)->getThemeByTemplate($template);

        if ($template->getConfigSets()->count() > 0) {
            return true;
        }

        if ($theme->useInheritanceConfig() && $template->getParent() instanceof Template) {
            return $this->hasTemplateConfigSet($template->getParent());
        }

        return false;
    }

    /** * Returns the id of the default shop. */
    private function getDefaultShopId(): int
    {
        

    private function injectConfig(Theme $theme, TabContainer $container): void
    {
        // Check if theme wants to inject parent configuration         if (!$theme->useInheritanceConfig() || $theme->getExtend() === null) {
            return;
        }

        $template = $this->repository->findOneBy([
            'template' => $theme->getTemplate(),
        ]);

        // No parent configured? cancel injection.         if (!$template instanceof Template || !$template->getParent() instanceof Template) {
            return;
        }

        
Home | Imprint | This part of the site doesn't use cookies.