/**
* In case we failed to import some invalid records, we export them as a new csv with the same format and
* an additional _error column.
*
* @param array<Entity|array<mixed>> $failedRecords
*/ privatefunctionexportInvalid(Context $context, array $failedRecords): Progress { $file = $this->logEntity->getFile();
// created a invalid records export if it doesn't exist
if(!$this->logEntity->getInvalidRecordsLogId() && $file instanceof ImportExportFileEntity){ $pathInfo = pathinfo($file->getOriginalName()); $newName = $pathInfo['filename'] . '_failed.' . ($pathInfo['extension'] ?? '');