Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
hydrateSearchResult example
if
(
!
empty
(
$term
)
)
{
$this
->
addSearchTermCondition
(
$entity
,
$builder
,
$term
)
;
}
$builder
->
setFirstResult
(
$offset
)
->
setMaxResults
(
$limit
)
;
}
$pagination
=
$this
->
getPaginator
(
$builder
)
;
$data
=
iterator_to_array
(
$pagination
)
;
$data
=
$this
->
hydrateSearchResult
(
$entity
,
$data
)
;
$this
->
View
(
)
->
assign
(
[
'success' => true,
'data' =>
$data
,
'total' =>
$pagination
->
count
(
)
,
]
)
;
}
/** * Sanitizes the passed term and queries the different areas of the search */