Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getMailsListQueryBuilder example
public
function
getMailTemplatesAction
(
)
{
$limit
=
(int)
$this
->
Request
(
)
->
getParam
(
'limit', 100
)
;
$offset
=
(int)
$this
->
Request
(
)
->
getParam
(
'start', 0
)
;
$order
=
$this
->
Request
(
)
->
getParam
(
'sort',
[
]
)
;
$filter
=
$this
->
Request
(
)
->
getParam
(
'filter',
[
]
)
;
$mailTemplatesQuery
=
$this
->
getModelManager
(
)
->
getRepository
(
Mail::
class
)
->
getMailsListQueryBuilder
(
$filter
,
$order
,
$offset
,
$limit
)
;
$mailTemplates
=
$mailTemplatesQuery
->
getQuery
(
)
->
getResult
(
AbstractQuery::HYDRATE_ARRAY
)
;
// Add a display name to the mail templates
$documentTypes
=
$this
->
getModelManager
(
)
->
getRepository
(
DocumentType::
class
)
->
findAll
(
)
;
$documentTypeNames
=
[
]
;
public
function
getMailListQuery
(
array
$filter
=
[
]
, ?array
$order
= null,
$offset
= null,
$limit
= null
)
{
return
$this
->
getMailsListQueryBuilder
(
$filter
,
$order
,
$offset
,
$limit
)
->
getQuery
(
)
;
}
/** * @param int|null $offset * @param int|null $limit * * @return QueryBuilder */
public
function
getMailsListQueryBuilder
(
array
$filter
=
[
]
, ?array
$order
= null,
$offset
= null,
$limit
= null
)
{
$builder
=
$this
->
getEntityManager
(
)
->
createQueryBuilder
(
)
;