return $builder;
} /**
* @param Query<Detail> $query
*
* @return array{0: array<int>, 1: int}
*/
public function getPaginatedResult($query) { $paginator =
Shopware()->
Models()->
createPaginator($query);
$paginator->
setUseOutputWalkers(true
);
$totalCount =
$paginator->
count();
$result =
array_map( function D
$item) { return $item->
getId();
},
iterator_to_array($paginator) );
// Detach currently handled models in order to avoid invalid models later