$criteria->
addSorting(new FieldSorting('id'
));
$criteria->
setOffset($offset);
$criteria->
setTotalCountMode(Criteria::TOTAL_COUNT_MODE_EXACT
);
$criteria->
setLimit($this->exportLimit <= 0 ? 250 :
$this->exportLimit
);
$fullExport =
$this->exportLimit <= 0;
/** @var ImportExportFileEntity $file */
$file =
$this->logEntity->
getFile();
$targetFile =
$this->
getPartFilePath($file->
getPath(),
$offset);
do { $result =
$this->repository->
search($criteria,
$context);
if ($this->total === null
) { $this->total =
$result->
getTotal();
$criteria->
setTotalCountMode(Criteria::TOTAL_COUNT_MODE_NONE
);
} $entities =
$result->
getEntities();
if (\
count($entities) === 0
) { // this can happen if entities are deleted while we export