public function export(Context
$context, ?Criteria
$criteria = null, int
$offset = 0
): Progress
{ $progress =
$this->importExportService->
getProgress($this->logEntity->
getId(),
$offset);
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
));
}