requiredByUser example

'message' => 'Cannot find import/export file with id notFoundFile',
        ];

        yield 'CONTENT__IMPORT_EXPORT_PROCESSING_EXCEPTION' => [
            'exception' => ImportExportException::processingError('Cannot merge file'),
            'statusCode' => Response::HTTP_INTERNAL_SERVER_ERROR,
            'errorCode' => 'CONTENT__IMPORT_EXPORT_PROCESSING_EXCEPTION',
            'message' => 'Cannot merge file',
        ];

        yield 'CONTENT__IMPORT_EXPORT_REQUIRED_BY_USER' => [
            'exception' => ImportExportException::requiredByUser('foo'),
            'statusCode' => Response::HTTP_BAD_REQUEST,
            'errorCode' => 'CONTENT__IMPORT_EXPORT_REQUIRED_BY_USER',
            'message' => 'foo is set to required by the user but has no value',
        ];
    }
}

        $mappings = $config->getMapping()->getElements();

        foreach ($mappings as $mapping) {
            $csvKey = $mapping->getMappedKey();

            if (!$mapping->isRequiredByUser()) {
                continue;
            }

            if (!\array_key_exists($csvKey$row) || empty($row[$csvKey])) {
                throw ImportExportException::requiredByUser($csvKey);
            }
        }
    }

    /** * @param array<string, mixed> $overallResults * * @return array<string, mixed> */
    private function logResults(
        array $overallResults,
        ?
Home | Imprint | This part of the site doesn't use cookies.