/**
* @param PresetMetaDataInterface[] $presetMetaData
*/
public function installOrUpdate(array
$presetMetaData) { $modelManager =
$this->presetResource->
getManager();
/** @var PresetMetaDataInterface $metaData */
foreach ($presetMetaData as $metaData) { $presetData =
[ 'name' =>
$metaData->
getName(),
'premium' =>
$metaData->
getPremium(),
'custom' =>
$metaData->
getCustom(),
'thumbnail' =>
$metaData->
getThumbnail(),
'preview' =>
$metaData->
getPreview(),
'translations' =>
$metaData->
getTranslations(),
'presetData' =>
json_encode($metaData->
getPresetData()),
'requiredPlugins' =>
$metaData->
getRequiredPlugins(),
'assetsImported' =>
$metaData->
getAssetsImported(),
];
$slugifiedName =
$this->slugService->
slugify($metaData->
getName());
$preset =
$modelManager->
getRepository(Preset::
class)->
findOneBy(['name' =>
$slugifiedName]);