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
aaae15ae
Commit
aaae15ae
authored
Oct 28, 2016
by
Simon Gadient
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IMP] Add identifier to arguments
refs KIME-4583
parent
c76d757d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
Classes/WE/SpreadsheetImport/SpreadsheetImportService.php
Classes/WE/SpreadsheetImport/SpreadsheetImportService.php
+22
-0
No files found.
Classes/WE/SpreadsheetImport/SpreadsheetImportService.php
View file @
aaae15ae
...
@@ -12,6 +12,7 @@ namespace WE\SpreadsheetImport;
...
@@ -12,6 +12,7 @@ namespace WE\SpreadsheetImport;
* */
* */
use
TYPO3\Flow\Annotations
as
Flow
;
use
TYPO3\Flow\Annotations
as
Flow
;
use
TYPO3\Flow\Persistence\QueryInterface
;
use
TYPO3\Flow\Persistence\RepositoryInterface
;
use
TYPO3\Flow\Persistence\RepositoryInterface
;
use
WE\SpreadsheetImport\Annotations\Mapping
;
use
WE\SpreadsheetImport\Annotations\Mapping
;
use
WE\SpreadsheetImport\Domain\Model\SpreadsheetImport
;
use
WE\SpreadsheetImport\Domain\Model\SpreadsheetImport
;
...
@@ -260,6 +261,7 @@ class SpreadsheetImportService {
...
@@ -260,6 +261,7 @@ class SpreadsheetImportService {
$propertyName
=
$mapping
->
queryPropertyName
?:
$property
;
$propertyName
=
$mapping
->
queryPropertyName
?:
$property
;
$constraints
[]
=
$query
->
equals
(
$propertyName
,
$value
);
$constraints
[]
=
$query
->
equals
(
$propertyName
,
$value
);
}
}
$this
->
mergeQueryConstraintsWithArgumentIdentifiers
(
$query
,
$constraints
);
if
(
!
empty
(
$constraints
))
{
if
(
!
empty
(
$constraints
))
{
return
$query
->
matching
(
$query
->
logicalAnd
(
$constraints
))
->
execute
()
->
getFirst
();
return
$query
->
matching
(
$query
->
logicalAnd
(
$constraints
))
->
execute
()
->
getFirst
();
}
else
{
}
else
{
...
@@ -267,6 +269,26 @@ class SpreadsheetImportService {
...
@@ -267,6 +269,26 @@ class SpreadsheetImportService {
}
}
}
}
/**
* @param \TYPO3\Flow\Persistence\QueryInterface $query
* @param array $constraints
*/
private
function
mergeQueryConstraintsWithArgumentIdentifiers
(
QueryInterface
$query
,
&
$constraints
)
{
$contextArguments
=
$this
->
settings
[
$this
->
spreadsheetImport
->
getContext
()][
'arguments'
];
if
(
is_array
(
$contextArguments
))
{
foreach
(
$contextArguments
as
$contextArgument
)
{
if
(
isset
(
$contextArgument
[
'identifier'
])
&&
$contextArgument
[
'identifier'
]
==
TRUE
)
{
$name
=
$contextArgument
[
'name'
];
$arguments
=
$this
->
spreadsheetImport
->
getArguments
();
if
(
array_key_exists
(
$name
,
$arguments
))
{
$value
=
$arguments
[
$name
];
$constraints
[]
=
$query
->
equals
(
$name
,
$value
);
}
}
}
}
}
/**
/**
* @param array $identifiers
* @param array $identifiers
*
*
...
...
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