$sPerPage =
(int) $this->
Request()->
getParam('sPerPage'
);
if ($sPerPage <= 0
) { $sPerPage = 1;
} $this->
View()->
assign([ 'sPage' =>
(int) $this->
Request()->
getParam('sPage'
),
'pages' =>
ceil($result->
getTotalCount() /
$sPerPage),
'baseUrl' =>
$this->
Request()->
getBaseUrl() .
$this->
Request()->
getPathInfo(),
'pageSizes' =>
explode('|',
$this->container->
get(\Shopware_Components_Config::
class)->
get('numberArticlesToShow'
)),
'shortParameters' =>
$this->container->
get(QueryAliasMapper::
class)->
getQueryAliases(),
'limit' =>
$sPerPage,
]);
$this->container->
get('events'
)->
notify('Shopware_Controllers_Widgets_Listing_fetchPagination_preFetch',
[ 'result' =>
$result,
'subject' =>
$this,
]);
} /**
* @param int|null $categoryId
*
* @return array<string, mixed>
*/