Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
WE.SpreadsheetImport
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Labels
Merge Requests
0
Merge Requests
0
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
packages
WE.SpreadsheetImport
Commits
0a7b07f2
Commit
0a7b07f2
authored
Nov 04, 2016
by
Simon Gadient
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IMP] Specific SpreadsheetImport validation group
refs KIME-4583
parent
3b4a91db
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
Classes/WE/SpreadsheetImport/FrontendMappingService.php
Classes/WE/SpreadsheetImport/FrontendMappingService.php
+1
-1
Classes/WE/SpreadsheetImport/SpreadsheetImportService.php
Classes/WE/SpreadsheetImport/SpreadsheetImportService.php
+3
-1
No files found.
Classes/WE/SpreadsheetImport/FrontendMappingService.php
View file @
0a7b07f2
...
@@ -122,7 +122,7 @@ class FrontendMappingService {
...
@@ -122,7 +122,7 @@ class FrontendMappingService {
$previewObject
=
$this
->
spreadsheetImportService
->
getObjectByRow
(
$record
);
$previewObject
=
$this
->
spreadsheetImportService
->
getObjectByRow
(
$record
);
$preview
=
array
();
$preview
=
array
();
$hasErrors
=
FALSE
;
$hasErrors
=
FALSE
;
$objectValidator
=
$this
->
validatorResolver
->
getBaseValidatorConjunction
(
$domain
);
$objectValidator
=
$this
->
validatorResolver
->
getBaseValidatorConjunction
(
$domain
,
SpreadsheetImportService
::
VALIDATION_GROUPS
);
$errors
=
$objectValidator
->
validate
(
$previewObject
)
->
getFlattenedErrors
();
$errors
=
$objectValidator
->
validate
(
$previewObject
)
->
getFlattenedErrors
();
foreach
(
$mapping
as
$property
=>
$columnMapping
)
{
foreach
(
$mapping
as
$property
=>
$columnMapping
)
{
/** @var Mapping $mapping */
/** @var Mapping $mapping */
...
...
Classes/WE/SpreadsheetImport/SpreadsheetImportService.php
View file @
0a7b07f2
...
@@ -23,6 +23,8 @@ use WE\SpreadsheetImport\Domain\Model\SpreadsheetImport;
...
@@ -23,6 +23,8 @@ use WE\SpreadsheetImport\Domain\Model\SpreadsheetImport;
*/
*/
class
SpreadsheetImportService
{
class
SpreadsheetImportService
{
const
VALIDATION_GROUPS
=
array
(
'Default'
,
'SpreadsheetImport'
);
/**
/**
* Domain object containing the configuration the service works with
* Domain object containing the configuration the service works with
*
*
...
@@ -204,7 +206,7 @@ class SpreadsheetImportService {
...
@@ -204,7 +206,7 @@ class SpreadsheetImportService {
$totalDeleted
=
0
;
$totalDeleted
=
0
;
$processedObjectIds
=
array
();
$processedObjectIds
=
array
();
$objectRepository
=
$this
->
getDomainRepository
();
$objectRepository
=
$this
->
getDomainRepository
();
$objectValidator
=
$this
->
validatorResolver
->
getBaseValidatorConjunction
(
$this
->
domain
);
$objectValidator
=
$this
->
validatorResolver
->
getBaseValidatorConjunction
(
$this
->
domain
,
self
::
VALIDATION_GROUPS
);
$sheet
=
$this
->
getFileActiveSheet
();
$sheet
=
$this
->
getFileActiveSheet
();
$persistRecordsChunkSize
=
intval
(
$this
->
settings
[
'persistRecordsChunkSize'
]);
$persistRecordsChunkSize
=
intval
(
$this
->
settings
[
'persistRecordsChunkSize'
]);
$totalCount
=
0
;
$totalCount
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment