$result->
setAvailableSortings($sortings);
} private function getCurrentSorting(ProductSortingCollection
$sortings, Request
$request): ProductSortingEntity
{ $key =
$request->
get('order'
);
if (!\
is_string($key)) { throw ProductException::
sortingNotFoundException(''
);
} $sorting =
$sortings->
getByKey($key);
if ($sorting !== null
) { return $sorting;
} throw ProductException::
sortingNotFoundException($key);
} private function getAvailableSortings(Request
$request, Context
$context): ProductSortingCollection
{ $criteria =
new Criteria();
$criteria->
setTitle('product-listing::load-sortings'
);