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
465b7131
Commit
465b7131
authored
Oct 02, 2017
by
Chivy Lim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TASK] Overwrite the default query property name used of argument setting
refs KIME-5209
parent
c732c13c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
Classes/WE/SpreadsheetImport/SpreadsheetImportService.php
Classes/WE/SpreadsheetImport/SpreadsheetImportService.php
+10
-0
No files found.
Classes/WE/SpreadsheetImport/SpreadsheetImportService.php
View file @
465b7131
...
@@ -332,7 +332,12 @@ class SpreadsheetImportService {
...
@@ -332,7 +332,12 @@ class SpreadsheetImportService {
$constraints
[]
=
$query
->
equals
(
$propertyName
,
$value
);
$constraints
[]
=
$query
->
equals
(
$propertyName
,
$value
);
}
}
$argumentIdentifierProperties
=
$this
->
getArgumentIdentifierProperties
();
$argumentIdentifierProperties
=
$this
->
getArgumentIdentifierProperties
();
$contextArguments
=
$this
->
settings
[
$this
->
spreadsheetImport
->
getContext
()][
'arguments'
];
foreach
(
$argumentIdentifierProperties
as
$property
=>
$value
)
{
foreach
(
$argumentIdentifierProperties
as
$property
=>
$value
)
{
$key
=
array_search
(
$property
,
array_column
(
$contextArguments
,
'name'
));
if
(
$key
!==
FALSE
&&
array_key_exists
(
'queryPropertyName'
,
$contextArguments
[
$key
]))
{
$property
=
$contextArguments
[
$key
][
'queryPropertyName'
];
}
$constraints
[]
=
$query
->
equals
(
$property
,
$value
);
$constraints
[]
=
$query
->
equals
(
$property
,
$value
);
}
}
if
(
!
empty
(
$constraints
))
{
if
(
!
empty
(
$constraints
))
{
...
@@ -351,7 +356,12 @@ class SpreadsheetImportService {
...
@@ -351,7 +356,12 @@ class SpreadsheetImportService {
$query
=
$this
->
getDomainRepository
()
->
createQuery
();
$query
=
$this
->
getDomainRepository
()
->
createQuery
();
$constraints
[]
=
$query
->
logicalNot
(
$query
->
in
(
'Persistence_Object_Identifier'
,
$identifiers
));
$constraints
[]
=
$query
->
logicalNot
(
$query
->
in
(
'Persistence_Object_Identifier'
,
$identifiers
));
// Include all the arguments into the query to get a subset only
// Include all the arguments into the query to get a subset only
$contextArguments
=
$this
->
settings
[
$this
->
spreadsheetImport
->
getContext
()][
'arguments'
];
foreach
(
$this
->
spreadsheetImport
->
getArguments
()
as
$name
=>
$value
)
{
foreach
(
$this
->
spreadsheetImport
->
getArguments
()
as
$name
=>
$value
)
{
$key
=
array_search
(
$name
,
array_column
(
$contextArguments
,
'name'
));
if
(
$key
!==
FALSE
&&
array_key_exists
(
'queryPropertyName'
,
$contextArguments
[
$key
]))
{
$name
=
$contextArguments
[
$key
][
'queryPropertyName'
];
}
$constraints
[]
=
$query
->
equals
(
$name
,
$value
);
$constraints
[]
=
$query
->
equals
(
$name
,
$value
);
}
}
return
$query
->
matching
(
$query
->
logicalAnd
(
$constraints
))
->
execute
();
return
$query
->
matching
(
$query
->
logicalAnd
(
$constraints
))
->
execute
();
...
...
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