array
$config =
[],
bool
$dryRun = false
): ImportExportLogEntity
{ $profileEntity =
$this->
findProfile($context,
$profileId);
if (!\
in_array($profileEntity->
getType(),
[ImportExportProfileEntity::TYPE_IMPORT, ImportExportProfileEntity::TYPE_IMPORT_EXPORT
], true
)) { throw new ProfileWrongTypeException($profileEntity->
getId(),
$profileEntity->
getType());
} $type =
$this->fileService->
detectType($file);
if ($type !==
$profileEntity->
getFileType()) { throw new UnexpectedFileTypeException($file->
getClientMimeType(),
$profileEntity->
getFileType());
} $fileEntity =
$this->fileService->
storeFile($context,
$expireDate,
$file->
getPathname(),
$file->
getClientOriginalName(), ImportExportLogEntity::ACTIVITY_IMPORT
);
$activity =
$dryRun ? ImportExportLogEntity::ACTIVITY_DRYRUN : ImportExportLogEntity::ACTIVITY_IMPORT;
return $this->
createLog($context,
$activity,
$fileEntity,
$profileEntity,
$config);
} public function cancel(Context
$context, string
$logId): void
{ $logEntity =
$this->
findLog($context,
$logId);