In Shopware 6.4 we created a separate import / export profile for our plugin and used EntityRepositoryDecorator
.
With Shopware 6.5 there is no longer an EntityRepositoryDecorator
.
The goal is to change the data of the entity during import before it is written to the database. For this we could use the event ImportExportBeforeImportRecordEvent
, unfortunately we have no information about which entity is being imported and cannot check this. We cannot execute the code to change the data for each individual entity.
You can get the entity name from the config provided by the event.
public function callbackMethodName $event): void
{
$entityName = $event->getConfig()->get('sourceEntity');
// ...
}
See ProductCategoryPathsSubscriber for an example.