importElementAssets example

$preset = $this->container->get(ModelManager::class)->getRepository(Preset::class)->find($id);

        if (!$preset instanceof Preset || $preset->getAssetsImported()) {
            $this->View()->assign(['success' => false]);

            return;
        }

        $synchronizerService = $this->container->get(PresetDataSynchronizerInterface::class);

        try {
            $synchronizerService->importElementAssets($preset$syncKey);
        } catch (PresetAssetImportException $e) {
            $this->View()->assign([
                'success' => false,
                'message' => $e->getMessage(),
            ]);

            return;
        }

        $this->View()->assign(['success' => true]);
    }

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