getThemeByTemplate example

$filePath = $file->getPath() . DIRECTORY_SEPARATOR . $file->getFilename();
        $zipUtils = ZipUtils::openZip($filePath);
        $zipUtils->extractTo($targetDirectory);
    }

    /** * Helper function which checks if the passed template * or the inheritance templates has configuration sets. */
    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;
    }

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

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

        // get Theme.php instance of the parent template         $parent = $this->util->getThemeByTemplate(
            $template->getParent()
        );

        $this->injectConfig($parent$container);

        $parent->createConfig($container);
    }

    /** * Helper function which checks if the configuration set is * already existing in the passed collection. * * @param Collection<int, Set> $collection */
$namespace = $this->getConfigSnippetNamespace($template);
        $namespace->read();

        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;
    }
/** * @throws Exception * * @return array */
    public function buildInheritances(Template $template)
    {
        $hierarchy = $this->buildInheritanceRecursive($template);

        $util = $this->util;
        $bare = array_filter($hierarchyfunction DTemplate $template) use ($util) {
            $theme = $util->getThemeByTemplate($template);

            return $theme->injectBeforePlugins();
        });

        $custom = array_filter($hierarchyfunction DTemplate $template) use ($util) {
            $theme = $util->getThemeByTemplate($template);

            return !$theme->injectBeforePlugins();
        });

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