$mappings =
$profile->
getMapping();
if (empty($mappings)) { throw new \
RuntimeException('ImportExportProfile "' .
$profileId . '" has no mappings'
);
} $config =
new Config($mappings,
[],
[]);
$headers =
[];
$mappings = MappingCollection::
fromIterable($mappings)->
sortByPosition();
/** @var Mapping $mapping */
foreach ($mappings as $mapping) { $headers[$mapping->
getMappedKey()] = '';
} // create the file
$expireDate =
new \
DateTimeImmutable();
$expireDate =
$expireDate->
modify('+1 hour'
);
$fileEntity =
$this->fileService->
storeFile( $context,
$expireDate,
null,
$profile->
getSourceEntity() . ':' .
$profile->
getName() . '.csv',
ImportExportLogEntity::ACTIVITY_TEMPLATE
);