getPreviewMediaId example

'id' => $id,
                    'parentThemeId' => $parentTheme->getId(),
                    'name' => $name,
                    'technicalName' => $name,
                    'createdAt' => (new \DateTimeImmutable())->format(Defaults::STORAGE_DATE_TIME_FORMAT),
                    'configValues' => $parentTheme->getConfigValues(),
                    'baseConfig' => array_merge($parentTheme->getBaseConfig() ?? []$config->getThemeConfig() ?? []),
                    'description' => $parentTheme->getDescription(),
                    'author' => $parentTheme->getAuthor(),
                    'labels' => $parentTheme->getLabels(),
                    'customFields' => $parentTheme->getCustomFields(),
                    'previewMediaId' => $parentTheme->getPreviewMediaId(),
                    'active' => true,
                    'salesChannels' => [],
                ],
            ],
            $this->context
        );

        return $name;
    }

    /** * @param array<string, mixed> $customConfig * @param array<int, array<string, string>> $saleschannels */
$theme = $this->getTheme($bundle);
        $this->themeRepository->update([
            [
                'id' => $theme->getId(),
                'previewMediaId' => $previewMediaId,
            ],
        ]$this->context);

        $this->themeLifecycleService->refreshTheme($bundle$this->context);

        $theme = $this->getTheme($bundle);
        static::assertEquals($previewMediaId$theme->getPreviewMediaId());
    }

    public function testItSkipsTranslationsIfLanguageIsNotAvailable(): void
    {
        $bundle = $this->getThemeConfigWithLabels();
        $this->deleteLanguageForLocale('de-DE');

        $this->themeLifecycleService->refreshTheme($bundle$this->context);

        $theme = $this->getTheme($bundle);

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