$newName =
$pathInfo['filename'
] . '_failed.' .
($pathInfo['extension'
] ?? ''
);
$newPath =
$file->
getPath() . '_invalid';
$config =
$this->logEntity->
getConfig();
$config['mapping'
][] =
[ 'key' => '_error',
'mappedKey' => '_error',
];
$config =
new Config($config['mapping'
],
$config['parameters'
] ??
[],
$config['updateBy'
] ??
[]);
if ($this->logEntity->
getProfileId() !== null
) { $failedImportLogEntity =
$this->importExportService->
prepareExport( $context,
$this->logEntity->
getProfileId(),
$file->
getExpireDate(),
$newName,
$config->
jsonSerialize(),
$newPath,
ImportExportLogEntity::ACTIVITY_INVALID_RECORDS_EXPORT
);
$this->logEntity->
setInvalidRecordsLog($failedImportLogEntity);