hasOldMedia example



        $baseConfig = $pluginConfiguration->getThemeConfig() ?? [];
        $installedBaseConfig = $installedConfiguration?->getThemeConfig() ?? [];

        $currentThemeMedia = null;
        $currentMediaIds = null;
        $toDeleteIds = null;
        // get existing MediaFiles         if ($theme !== null && \array_key_exists('fields', $theme->getBaseConfig() ?? [])) {
            foreach ($theme->getBaseConfig()['fields'] as $key => $field) {
                if ($this->hasOldMedia($field) === false) {
                    continue;
                }
                $currentMediaIds[$key] = $field['value'];
            }

            if (!empty($currentMediaIds)) {
                $currentThemeMedia = $this->mediaRepository->search(new Criteria($currentMediaIds)$context);
            }
        }

        if (\array_key_exists('fields', $baseConfig)) {
            
Home | Imprint | This part of the site doesn't use cookies.