Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getLastExecutionTime example
$entities
=
$this
->taskRegistry->
getAllTasks
(
Context::
createDefaultContext
(
)
)
;
$table
=
new
Table
(
$output
)
;
$table
->
setHeaders
(
[
'Name', 'Next execution', 'Last execution', 'Run interval', 'Status'
]
)
;
/** @var ScheduledTaskEntity $entity */
foreach
(
$entities
as
$entity
)
{
$table
->
addRow
(
[
$entity
->
getName
(
)
,
$entity
->
getNextExecutionTime
(
)
->
format
(
\DATE_ATOM
)
,
$entity
->
getLastExecutionTime
(
)
?
$entity
->
getLastExecutionTime
(
)
->
format
(
\DATE_ATOM
)
: '-',
$entity
->
getRunInterval
(
)
,
$entity
->
getStatus
(
)
,
]
)
;
}
$table
->
render
(
)
;
return
self::SUCCESS;
}
}