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
5e8c8d86
Commit
5e8c8d86
authored
Oct 28, 2016
by
Simon Gadient
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IMP] Import status Draft
refs KIME-4583
parent
aaae15ae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
8 deletions
+23
-8
Classes/WE/SpreadsheetImport/Command/SpreadsheetImportCommandController.php
...heetImport/Command/SpreadsheetImportCommandController.php
+1
-1
Classes/WE/SpreadsheetImport/Domain/Model/SpreadsheetImport.php
...s/WE/SpreadsheetImport/Domain/Model/SpreadsheetImport.php
+6
-5
Classes/WE/SpreadsheetImport/Domain/Repository/SpreadsheetImportRepository.php
...tImport/Domain/Repository/SpreadsheetImportRepository.php
+16
-2
No files found.
Classes/WE/SpreadsheetImport/Command/SpreadsheetImportCommandController.php
View file @
5e8c8d86
...
@@ -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
PreviousOne
InQueue
();
$spreadsheetImport
=
$this
->
spreadsheetImportRepository
->
find
Next
InQueue
();
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/Model/SpreadsheetImport.php
View file @
5e8c8d86
...
@@ -19,10 +19,11 @@ use Doctrine\ORM\Mapping as ORM;
...
@@ -19,10 +19,11 @@ use Doctrine\ORM\Mapping as ORM;
*/
*/
class
SpreadsheetImport
{
class
SpreadsheetImport
{
const
IMPORTING_STATUS_IN_QUEUE
=
0
;
const
IMPORTING_STATUS_DRAFT
=
0
;
const
IMPORTING_STATUS_IN_PROGRESS
=
1
;
const
IMPORTING_STATUS_IN_QUEUE
=
1
;
const
IMPORTING_STATUS_COMPLETED
=
2
;
const
IMPORTING_STATUS_IN_PROGRESS
=
2
;
const
IMPORTING_STATUS_FAILED
=
3
;
const
IMPORTING_STATUS_COMPLETED
=
3
;
const
IMPORTING_STATUS_FAILED
=
4
;
/**
/**
* @var string
* @var string
...
@@ -72,7 +73,7 @@ class SpreadsheetImport {
...
@@ -72,7 +73,7 @@ class SpreadsheetImport {
* @var int
* @var int
* @ORM\Column(options={"default": 0})
* @ORM\Column(options={"default": 0})
*/
*/
protected
$importingStatus
=
self
::
IMPORTING_STATUS_
IN_QUEUE
;
protected
$importingStatus
=
self
::
IMPORTING_STATUS_
DRAFT
;
/**
/**
* @var int
* @var int
...
...
Classes/WE/SpreadsheetImport/Domain/Repository/SpreadsheetImportRepository.php
View file @
5e8c8d86
...
@@ -29,10 +29,10 @@ class SpreadsheetImportRepository extends Repository {
...
@@ -29,10 +29,10 @@ class SpreadsheetImportRepository extends Repository {
/**
/**
* @return SpreadsheetImport
* @return SpreadsheetImport
*/
*/
public
function
find
PreviousOne
InQueue
()
{
public
function
find
Next
InQueue
()
{
$query
=
$this
->
createQuery
();
$query
=
$this
->
createQuery
();
$constraint
=
$query
->
logicalAnd
(
$constraint
=
$query
->
logicalAnd
(
$query
->
equals
(
'importingStatus'
,
SpreadsheetImport
::
IMPORTING_STATUS_IN_QUEUE
),
$query
->
lessThanOrEqual
(
'importingStatus'
,
SpreadsheetImport
::
IMPORTING_STATUS_IN_QUEUE
),
$query
->
lessThanOrEqual
(
'scheduleDate'
,
new
\DateTime
())
$query
->
lessThanOrEqual
(
'scheduleDate'
,
new
\DateTime
())
);
);
return
$query
->
matching
(
$constraint
)
return
$query
->
matching
(
$constraint
)
...
@@ -51,4 +51,18 @@ class SpreadsheetImportRepository extends Repository {
...
@@ -51,4 +51,18 @@ class SpreadsheetImportRepository extends Repository {
return
$query
->
matching
(
$constraint
)
->
execute
();
return
$query
->
matching
(
$constraint
)
->
execute
();
}
}
/**
* @param string $context
* @param array $arguments
*
* @return \TYPO3\Flow\Persistence\QueryResultInterface
*/
public
function
findByContextAndArguments
(
$context
,
$arguments
=
array
())
{
$query
=
$this
->
createQuery
();
$constraint
=
$query
->
logicalAnd
(
$query
->
equals
(
'context'
,
$context
),
$query
->
equals
(
'arguments'
,
serialize
(
$arguments
))
);
return
$query
->
matching
(
$constraint
)
->
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