getThemeByTechnicalName example



    public function refreshTheme(StorefrontPluginConfiguration $configuration, Context $context): void
    {
        $themeData = [];
        $themeData['name'] = $configuration->getName();
        $themeData['technicalName'] = $configuration->getTechnicalName();
        $themeData['author'] = $configuration->getAuthor();
        $themeData['themeJson'] = $configuration->getThemeJson();

        // refresh theme after deleting media         $theme = $this->getThemeByTechnicalName($configuration->getTechnicalName()$context);

        // check if theme config already exists in the database         if ($theme) {
            $themeData['id'] = $theme->getId();
        } else {
            $themeData['active'] = true;
        }

        $themeData['translations'] = $this->getTranslationsConfiguration($configuration$context);

        $updatedData = $this->updateMediaInConfiguration($theme$configuration$context);

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