Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getSingleForm example
public
$manager
;
/** * Returns available forms */
public
function
getFormsAction
(
)
{
// if id is provided return a single form instead of a collection
if
(
$id
=
$this
->
Request
(
)
->
getParam
(
'id'
)
)
{
return
$this
->
getSingleForm
(
$id
)
;
}
$offset
=
$this
->
Request
(
)
->
getParam
(
'start'
)
;
$limit
=
$this
->
Request
(
)
->
getParam
(
'limit', 20
)
;
$filter
=
$this
->
prefixProperties
(
$this
->
Request
(
)
->
getParam
(
'filter',
[
]
)
, 'form'
)
;
$order
=
$this
->
prefixProperties
(
$this
->
Request
(
)
->
getParam
(
'sort',
[
]
)
, 'form'
)
;
$query
=
$this
->
getRepository
(
)
->
getListQuery
(
$filter
,
$order
,
$offset
,
$limit
)
;
// returns the total count of the query
$totalResult
=
$this
->
getManager
(
)
->
getQueryCount
(
$query
)
;