if (empty($themeData['id'
])) { $themeData['id'
] =
current($writtenEvent->
getPrimaryKeys(ThemeDefinition::ENTITY_NAME
));
} $this->themeRepository->
upsert([$themeData],
$context);
if (!
empty($themeData['toDeleteMedia'
])) { $this->themeMediaRepository->
delete($themeData['toDeleteMedia'
],
$context);
} $parentThemes =
$this->
getParentThemes($configuration,
$themeData['id'
]);
$parentCriteria =
new Criteria();
$parentCriteria->
addFilter(new EqualsFilter('childId',
$themeData['id'
]));
/** @var list<array<string, string>> $toDeleteIds */
$toDeleteIds =
$this->themeChildRepository->
searchIds($parentCriteria,
$context)->
getIds();
$this->themeChildRepository->
delete($toDeleteIds,
$context);
$this->themeChildRepository->
upsert($parentThemes,
$context);
} public function removeTheme(string
$technicalName, Context
$context): void
{ $criteria =
new Criteria();