Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getBackupListQuery example
public
function
getList
(
$offset
,
$limit
)
{
/** @var Query<array<string, mixed>> $query */
$query
=
$this
->
getDqlHelper
(
)
->
getEntityManager
(
)
->
getRepository
(
BackupModel::
class
)
->
getBackupListQuery
(
$offset
,
$limit
)
;
$query
->
setHydrationMode
(
AbstractQuery::HYDRATE_ARRAY
)
;
$paginator
=
Shopware
(
)
->
Models
(
)
->
createPaginator
(
$query
)
;
$totalCount
=
$paginator
->
count
(
)
;
$backups
=
iterator_to_array
(
$paginator
)
;
return
[
'totalCount' =>
$totalCount
,
'data' =>
$backups
,
]
;
}