Commit 0a7b07f2 authored by Simon Gadient's avatar Simon Gadient

[IMP] Specific SpreadsheetImport validation group

refs KIME-4583
parent 3b4a91db
......@@ -122,7 +122,7 @@ class FrontendMappingService {
$previewObject = $this->spreadsheetImportService->getObjectByRow($record);
$preview = array();
$hasErrors = FALSE;
$objectValidator = $this->validatorResolver->getBaseValidatorConjunction($domain);
$objectValidator = $this->validatorResolver->getBaseValidatorConjunction($domain, SpreadsheetImportService::VALIDATION_GROUPS);
$errors = $objectValidator->validate($previewObject)->getFlattenedErrors();
foreach ($mapping as $property => $columnMapping) {
/** @var Mapping $mapping */
......
......@@ -23,6 +23,8 @@ use WE\SpreadsheetImport\Domain\Model\SpreadsheetImport;
*/
class SpreadsheetImportService {
const VALIDATION_GROUPS = array('Default', 'SpreadsheetImport');
/**
* Domain object containing the configuration the service works with
*
......@@ -204,7 +206,7 @@ class SpreadsheetImportService {
$totalDeleted = 0;
$processedObjectIds = array();
$objectRepository = $this->getDomainRepository();
$objectValidator = $this->validatorResolver->getBaseValidatorConjunction($this->domain);
$objectValidator = $this->validatorResolver->getBaseValidatorConjunction($this->domain, self::VALIDATION_GROUPS);
$sheet = $this->getFileActiveSheet();
$persistRecordsChunkSize = intval($this->settings['persistRecordsChunkSize']);
$totalCount = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment