getThemeDependencyMapping example

/** * @throws ThemeAssignmentException * @throws InconsistentCriteriaIdsException */
    private function validateThemeAssignment(?string $themeId): void
    {
        if (!$themeId) {
            return;
        }

        if ($this->themeService->getThemeDependencyMapping($themeId)->count() === 0) {
            return;
        }

        $this->throwAssignmentException($themeId);
    }

    private function changeThemeActive(ThemeDependencies $themeData, bool $active, Context $context): void
    {
        if ($themeData->getId() === null) {
            return;
        }

        
/** * Compiles all dependend saleschannel/Theme combinations * * @return array<int, string> */
    public function compileThemeById(
        string $themeId,
        Context $context,
        ?StorefrontPluginConfigurationCollection $configurationCollection = null,
        bool $withAssets = true
    ): array {
        $mappings = $this->getThemeDependencyMapping($themeId);

        $compiledThemeIds = [];
        foreach ($mappings as $mapping) {
            $this->themeCompiler->compileTheme(
                $mapping->getSalesChannelId(),
                $mapping->getThemeId(),
                $this->configLoader->load($mapping->getThemeId()$context),
                $configurationCollection ?? $this->extensionRegistry->getConfigurations(),
                $withAssets,
                $context
            );

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