Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
EnrichExportCriteriaEvent example
if
(
$progress
->
isFinished
(
)
)
{
return
$progress
;
}
$config
= Config::
fromLog
(
$this
->logEntity
)
;
$criteriaBuilder
=
new
CriteriaBuilder
(
$this
->repository->
getDefinition
(
)
)
;
$criteria
=
$criteria
=== null ?
new
Criteria
(
)
:
clone
$criteria
;
$criteriaBuilder
->
enrichCriteria
(
$config
,
$criteria
)
;
$enrichEvent
=
new
EnrichExportCriteriaEvent
(
$criteria
,
$this
->logEntity
)
;
$this
->eventDispatcher->
dispatch
(
$enrichEvent
)
;
if
(
$criteria
->
getSorting
(
)
===
[
]
)
{
// default sorting
$criteria
->
addSorting
(
new
FieldSorting
(
'createdAt', FieldSorting::ASCENDING
)
)
;
}
$criteria
->
addSorting
(
new
FieldSorting
(
'id'
)
)
;
$criteria
->
setOffset
(
$offset
)
;
$criteria
->
setTotalCountMode
(
Criteria::TOTAL_COUNT_MODE_EXACT
)
;