sortingNotFoundException example

$result->setSorting($currentSortingKey);

        $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
    {
Home | Imprint | This part of the site doesn't use cookies.