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
d11970b3
Commit
d11970b3
authored
Oct 27, 2016
by
Chivy Lim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TASK] Correct importing queue order
refs KIME-3603
parent
24a4c578
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
Classes/WE/SpreadsheetImport/Command/SpreadsheetImportCommandController.php
...heetImport/Command/SpreadsheetImportCommandController.php
+1
-1
Classes/WE/SpreadsheetImport/Domain/Repository/SpreadsheetImportRepository.php
...tImport/Domain/Repository/SpreadsheetImportRepository.php
+17
-1
No files found.
Classes/WE/SpreadsheetImport/Command/SpreadsheetImportCommandController.php
View file @
d11970b3
...
@@ -54,7 +54,7 @@ class SpreadsheetImportCommandController extends CommandController {
...
@@ -54,7 +54,7 @@ class SpreadsheetImportCommandController extends CommandController {
$this
->
quit
();
$this
->
quit
();
}
}
/** @var SpreadsheetImport $spreadsheetImport */
/** @var SpreadsheetImport $spreadsheetImport */
$spreadsheetImport
=
$this
->
spreadsheetImportRepository
->
find
OneByImportingStatus
(
SpreadsheetImport
::
IMPORTING_STATUS_IN_QUEUE
);
$spreadsheetImport
=
$this
->
spreadsheetImportRepository
->
find
PreviousOneInQueue
(
);
if
(
$spreadsheetImport
instanceof
SpreadsheetImport
)
{
if
(
$spreadsheetImport
instanceof
SpreadsheetImport
)
{
// mark importing status as "Progressing" before continuing the importing
// mark importing status as "Progressing" before continuing the importing
$spreadsheetImport
->
setImportingStatus
(
SpreadsheetImport
::
IMPORTING_STATUS_IN_PROGRESS
);
$spreadsheetImport
->
setImportingStatus
(
SpreadsheetImport
::
IMPORTING_STATUS_IN_PROGRESS
);
...
...
Classes/WE/SpreadsheetImport/Domain/Repository/SpreadsheetImportRepository.php
View file @
d11970b3
...
@@ -12,7 +12,9 @@ namespace WE\SpreadsheetImport\Domain\Repository;
...
@@ -12,7 +12,9 @@ namespace WE\SpreadsheetImport\Domain\Repository;
* */
* */
use
TYPO3\Flow\Annotations
as
Flow
;
use
TYPO3\Flow\Annotations
as
Flow
;
use
TYPO3\Flow\Persistence\QueryInterface
;
use
TYPO3\Flow\Persistence\Repository
;
use
TYPO3\Flow\Persistence\Repository
;
use
WE\SpreadsheetImport\Domain\Model\SpreadsheetImport
;
/**
/**
* @Flow\Scope("singleton")
* @Flow\Scope("singleton")
...
@@ -22,7 +24,21 @@ class SpreadsheetImportRepository extends Repository {
...
@@ -22,7 +24,21 @@ class SpreadsheetImportRepository extends Repository {
/**
/**
* @var array
* @var array
*/
*/
protected
$defaultOrderings
=
array
(
'scheduleDate'
=>
\TYPO3\Flow\Persistence\QueryInterface
::
ORDER_ASCENDING
);
protected
$defaultOrderings
=
array
(
'scheduleDate'
=>
QueryInterface
::
ORDER_DESCENDING
);
/**
* @return SpreadsheetImport
*/
public
function
findPreviousOneInQueue
()
{
$query
=
$this
->
createQuery
();
$constraint
=
$query
->
logicalAnd
(
$query
->
equals
(
'importingStatus'
,
SpreadsheetImport
::
IMPORTING_STATUS_IN_QUEUE
),
$query
->
lessThanOrEqual
(
'scheduleDate'
,
new
\DateTime
())
);
return
$query
->
matching
(
$constraint
)
->
setOrderings
(
array
(
'scheduleDate'
=>
QueryInterface
::
ORDER_ASCENDING
))
->
execute
()
->
getFirst
();
}
/**
/**
* @param \DateTime $dateTime
* @param \DateTime $dateTime
...
...
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